Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Replacing table in a database question
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Replacing table in a database question
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01055820
Message ID:
01055820
Views:
50
I am building a routine to get rid of table MEMO corruption.
The routine copies all "good" records to a new table. The new table is created with the same structure as the original table, as the following:
USE ORIG_FILE in 0
afields( aDbfStruct )
create TABLE TEMP_COPY from array aDbfStruct
Once the program copies all records, I need to rename the TEMP_COPY to ORIG_FILE. Would the following sequence be a correct:
1. Drop ORIG_FILE from the database
2. Erase ORIG_FILE
3. Rename TEMP_COPY to ORIG_FILE
4. Add new ORIG_FILE to the database

Or is there a more efficient and better method to accomplish this?

Thank you in advance for any suggestions.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Next
Reply
Map
View

Click here to load this message in the networking platform