Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table Paths
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00057214
Message ID:
00057316
Views:
31
>>>>Is there a way to get the table paths from the DATABASE (DBC)
>>>>I tryed to use the ADBOBJECTS with tables but this only returns
>>>>the name with out the path. When I used the DBC I saw a memo field
>>>>that conntained the path and table name in it. I was hoping for
>>>>a simple VFP function that I have missed.
>>>>
>>>>Charles
>>>
>>>Select table1
>>>? dbf()
>>
>>I should have explained better. I am building a version control
>>for one of my apps and I try to come up with some solutions to problems.
>>If the DATABASE is missing I FREE the tables recreate the database and add
>>the tables back into it. The problem is this:
>> Create a database
>> Add several tables
>> Then delete one table (could happen)
>> : Now if you try and readd it to the database
>> : it says table name already used
>> : Try and drop or delete the table from the database
>> : and it says it can't find the table.
>> The only solution I have found it to create a temp table with
>> the same name free then drop the table from the database. But to
>> create it so the database can drop it I need it in the same path
>> as the original.
>>
>>
>>Charles
>
>
>If the .DBF() file has been deleted (doesn't exist) and you simply want to remove it from the database treat the table record and the other records associated with it (fields, relations, views) like records in any other table:
>
>SELECT objectid FROM database.dbc INTO CURSOR cMissingTable WHERE objecttype = 'Table' AND objectname = 'missing'
>DELETE FROM database.dbc WHERE objectid = cMissingTable.objectid OR parentid = cMissingTable.objectid OR (objecttype = 'Relation' AND 'missing' $ property)
>SELECT database.dbc
>REINDEX
>USE
>USE IN cMissingTable
>
>Getting rid of any persistant relationships can be a little sticky IIF you have any tables have field names that are the same as any of the tables in the database (w/o '.dbf'). For a relation, the parentid represents the child table and the property field contains a reference to the parent table.
>
>You'd also want to make adjustments for any views based on the missing table....
>
>Dan


Thanks but how would I know what table is missing without first.
getting an error or without getting the database path.
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform