Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Here is an easy one, table exists
Message
From
17/06/2003 13:37:57
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Here is an easy one, table exists
Miscellaneous
Thread ID:
00800885
Message ID:
00800885
Views:
50
Hey, I am wanting to test for a table existing in a dbc. If it is already is there I want to remove it and replace it with a new table. What is the easiest command to do this with? I am not really worried about the replacement, just the testing for it to begin with.

Thought about:

llexists = !empty(dbgetprop(cdbfname,[table],[path]))

But then I have to trap the error if it isn't there.

----
If I am going to do that I might as well do:

remove table (cdbftable) recycle && or should I use delete?

Then again I have to error trap in case it isn't already there.

----
Also thought about:

copy stru exte to tempdbf
sele 0
use tempdbf
loca for allt(field_name) = cdbfname
llexist = found()

But this seems cumbersome.

In the back of my mind I have a feeling like there must be a nifty little command I am forgetting that would be simpler that any of these approaches.
Carole Shaw
Fred Hutchinson Cancer Research Center

Eagles may soar, but weasels don't get sucked into jet engines.
Next
Reply
Map
View

Click here to load this message in the networking platform