Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Evaluating a file's format before using it in a SELECT
Message
From
16/07/1998 12:31:41
Ernie Veniegas
Micro System Solutions, Inc.
Calistoga, California, United States
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00118163
Message ID:
00118177
Views:
20
>First you can test to see if the file even exists using the *file()* function. Use the textbox value and add ".DBF" to it for testing. Use can use *on error* to trap errors. Then, try to open the table. If all passes, then execute the query.

Thanks for the fast response, Mark. I already use FILE() to make sure the selected/specified table already exists and also test for a .DBF extension. But I hadn't thought of trying to USE the file before trying it in the select and messing with my framework's ON ERROR to intercept error 15. Okay, we'll give that a try. (I'm always nervous working AGAINST what the Framework wants to do.)

I had been playing with FOPEN(&TheirFile) and FREAD() and HEADER() to see if there wasn't something in the header of the file that I could evaluate ... come to think of it, I seem to recall an FPA article my Max Rubel on the subject ... I'll go look.

Thanks again.

(How are things in Dallas?)
Ernie Veniegas
Micro System Solutions
... sensible software by design
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform