Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Recreating DBC nightmare
Message
From
17/04/1998 20:03:46
Raul Davila
Davila Programming Services
Toa Alta, Puerto Rico
 
 
To
17/04/1998 18:13:30
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00093014
Message ID:
00093087
Views:
30
>>Hi:
>>
>> I've always been used to work with free tables since FPDOS 2.0
>> Until now I've always used a small routine to check if any of
>> the tables were "accidentally" erased and prompt the user
>> if the table should be recreated.
>>
>> Databases are making this process a nightmare!
>>
>> 1. If a table is erased you can't do a REMOVE TABLE, VFP will complain
>>that the table is not on the disk and cannot remove it from the DBC.
>> 2. If I create the table while the DBC is open VFP complains that there is already a table with that name in the DBC.
>>Actually the table is added but it is not opened, when I USE it and recreate the index an error remains in the DBC
>>
>> After 3 mugs of coffee and a pack of Marlboros I found this:
>> Given MYDATA.DBC contains TABLE1.DBF which is index on field F1
>>
>> ** Emulate the "table accidentally erased by user dilemma"
>> ERASE TABLE1.DBF
>> ERASE TABLE1.CDX
>>
>> OPEN DATA MYDATA
>> CREATE TABLE TABLE1 (F1 C(5))
>> ** error 1571 is triggered, I trap it and don't let the user know what happened.
>> ** Although the error is triggered the table is created and added to the DBC.
>> ** Usually CREATE TABLE leaves the table opened but in this case it doesn't.
>> USE TABLE1 && CREATE TABLE did not leave it open
>> INDEX ON F1
>> ** error 1561 is triggered. "Database is invalid. Please validate."
>> ** VALIDATE DATA will not fix the problem unless RECOVER is used.
>> ** Needless to say RECOVER cannot be used within a program!!!
>>
>> The table and the index seem to be usable but the error inside the DBC will remain.
>>
>> IMHO the perfect solution would be to do a VALIDATE DATA RECOVER programmatically, another one for the Tahoe wishlist.
>> Sorry for the long post, but I guess it's better 1 long post with a lot of info that a long thread with all the info scattered. :)
>>
>>Any ideas are welcome and greatly appreciated.
>>
>>TIA
>
>Take a look Stonefield database tools, for VFP this should help with the problem..

Hi Tony:

I downloaded a demo their DataBase Toolkit. Although it has a lot of things
the demo doesn't show strong features of what I really need. Aside from the
fact that I can't afford the $250.00 right now.

There must be a good clean way of recreating DBCs whose tables have been deleted.
I'll keep experimenting.

Thnx
R. Davila
DBA / Network Administrator
Administracion de Fomento Comercial
Gobierno de Puerto Rico

Still waiting for FoxPro for LINUX
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform