Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Converting Fox 26 tables to VFP
Message
De
17/01/2000 10:05:28
 
 
À
17/01/2000 07:08:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00318889
Message ID:
00318956
Vues:
20
>I'm trying to 'hack' the header to convert a Fox 26 file to be a VFP file so I can silently add it to a DBC.
>
>I am writing 30h to the first character of the header file but it moans that the file was created with a pre-release version of VFP - probably a Beta of version 3.
>
>What am I missing?
>

Not only is the value of the byte different, the size of the header is different in later releases of VFP, and other content as well. You'd be much better off doing something like:
PROCEDURE MakeMeAVFPFile
LPARAMETER cFileNameWithoutExtension
LOCAL cTempName, nFH
cTempName = SYS(2015)
USE (cFileNameWithoutExtension) EXCLUSIVE
COPY TO (cTempName) WITH PRODUCTION  && Make an equivalent file in VFP format
USE
FLUSH
nFH = FOPEN(cFileNameWithoutExtension+'.DBF')
DO WHILE nFH = -1  && make sure that we've written the file to disk before proceeding
   nFH = FOPEN(cFileNameWithoutExtension+'.DBF')
ENDDO
=FCLOSE(nFH)
ERASE (cFileNameWithoutExtension + '.DBF')
RENAME (cTempName+'.DBF') TO (cFileNameWithoutExtension + '.DBF')
IF FILE(cFileNameWithoutExtension+'.CDX')
   ERASE (cFileNameWithoutExtension + '.CDX')
   RENAME (cTempName+'.CDX') TO (cFileNameWithoutExtension + '.CDX')
ENDIF
IF FILE(cFileNameWithoutExtension+'.FPT')
   ERASE (cFileNameWithoutExtension + '.FPT')
   RENAME (cTempName+'.FPT') TO (cFileNameWithoutExtension + '.FPT')
ELSE
   *  If it's an old dBASE file, it might have the older .DBT file extension on the memo
   IF FILE(cFileNameWithoutExtension+'.DBT')
      ERASE (cFileNameWithoutExtension + '.DBT')
      RENAME (cTempName+'.FPT') TO (cFileNameWithoutExtension + '.FPT')
   ENDIF
ENDIF
RETURN
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform