Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determing file type
Message
 
À
25/05/1999 18:43:37
Ernie Veniegas
Micro System Solutions, Inc.
Calistoga, Californie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00222674
Message ID:
00222754
Vues:
17
Hi Earnie,

You can check the file using the low-level file functions. Look at the first byte in the file. Valid values for dbf files are:

0x02 FoxBase
0x03 FoxBase+/dBase III+ (no memo)
0x30 Visual FoxPro
0x43 dBase IV (SQL Table files, no memo)
0x63 dBase IV (SQL System files, no memo)
0x83 FoxBase+/dBase III+ (w/memo)
0x8B dBase IV (w/memo)
0xCB dBase IV (SQL Table files, w/memo)
0xF5 FoxPro 2.x (or earlier w/memo)
0xFB FoxBase

(from the help file in VFP 6 under Using VFP/Programmer's Guide/Appendix/Table Structures of Table Files)


>>>Is there an easy way to check to see if a file is a valid DBF?
>>>
>>>I'm issuing an APPEND FROM myfile.dbf. This works fine and dandy until someone points to a file that's not a DBF. VFP issues the error "Not a table." Is there a way to check for this before I issues to APPEND? For that matter, what do apps look at to determine what kind of file it's dealing with? Is there something reliable in the header?
>>
>>
>>You can trap it in the Error Method.
>
>Thanks Craig. I guess that means I can't test it ahead of time and will have to do it after the fact, huh? >sigh< Oh well ...
kenweber
GCom2 Solutions
Microsoft Certified Professional

Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform