Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test if a table is valid before opening
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01307527
Message ID:
01307529
Views:
9
>Is there a way of testing if a table (filename.dbf) is valid before attempting to open and use it. I have an application that uses tables that are sent via FTP, and every once in awhile, I get one that gives the error message that "c:\path\filename.dbf is not a table." and my program crashes.
>Thanks!

Wrap your use command into TRY...ENDTRY
* Check if table is valid
TRY
  USE mytable IN 0
CATCH TO oErr WHEN oErr.ErrorNo = 15
  *...
ENDTRY
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform