Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
DBC Contained Tables
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00212929
Message ID:
00213051
Vues:
30
>>>>Does anybody have some example code to USE a .DBC (ie not OPEN DATABASE) and read from its Property field the table name and path for all contained tables (objecttype = Table)? We want to ensure that the user has not deleted any before opening the database in the normal manner.
>>>>
>>>>TIA, Kevin
>>>
>>>You can use the dbc as if it were a dbf - USE database.dbc IN 0 SHARED. It is actually just a normal dbf itself as is everything in VFP (Form, Report, etc).
>>>
>>>Mostly filled with memo fields.
>>
>>Hi Nigel,
>>
>>Yes, that is what I have done. However, the field concerned - Property - is not a plain text field (binary memo I think), and I cannot just read the data. What I am looking for is help with interpreting the data in that field.
>>
>>Kevin
>
>I've just looked at this and nothing jumps out at me. The sequence of ascii values are 8,0,0,0,1,0,2,1,20,0,0,0,1,0,1 and then the table name (position 16). So SUBSTR(property,16) will return the table name. The path will be the same as the container path.


Thanks for that. Assuming it always starts at position 16, it works unless there are a lot of table rules / comments in the memo field, which can result in string too long errors. I have therefore started from position 16 and carried on to find the end of a ".DBF", and used that for a substring to give the desired table name. So far so good.

Kevin
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform