Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check for tag existance without opening the table
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01080193
Message ID:
01080242
Views:
13
This message has been marked as a message which has helped to the initial question of the thread.
>>>Hi everybody,
>>>
>>>Is there a way to test for tag existance just by opening database and not the table?
>>>
>>>Thanks.
>>
>>dbc tables and tag repository:
>>
>>CLOSE DATABASES ALL
>>USE HOME(2)+'Northwind\northwind.dbc' IN 0 ALIAS dbc NOUPDATE
>>
>>SELECT T.ObjectName table,I.ObjectName Tag  FROM dbc T JOIN dbc  I ON T.ObjectId = I.ParentId;
>>WHERE T.objecttype == 'Table' AND I.objecttype == 'Index'
>>
>>Of course, the whole table/index files would be able not to exist or to be corrupt
>
>Thanks. I've decided to go with opening the file and using TAGNO()

You do not even have to close the database to query the records from the DBC --
SELECT dbc1.ObjectName table, dbc2.ObjectName Tag ;
 FROM HOME(2)+'Northwind\northwind.dbc' dbc1 ;
 JOIN HOME(2)+'Northwind\northwind.dbc' dbc2 ;
 ON dbc1.ObjectId = dbc2.ParentId ;
 WHERE dbc1.objecttype == 'Table' ;
 AND dbc2.objecttype == 'Index'
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform