Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting incompatible SQL statements for running in VFP
Message
From
27/10/2004 03:27:58
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00954777
Message ID:
00954784
Views:
22
>We have several applications written in VFP 7. Does anyone have an utility that can look at our source code and highlight SQL statements that will be incompatible with VFP 8?
>Note: I do NOT want to SET ENGINEBEHAVIOUR TO 70

Interesting challenge.

I don't have 8.0 so I can't test this, but do you know if an incompatible statement throws an error at compile time? If so, a simple RECOMPILE ALL on your project in VFP8 (after backing up somewhere safe, of course!) should do it.

If not, this is likely to be quite challenging. One approach would be to programmatically scan all of your source, copy out all SQL commands to separate .PRGs, then COMPILE and run them, and see which generate run-time errors. Of course, you'd need to provide at least dummy data environments for each statement, and possibly local or global variables and/or object properties if referenced, not to mention anything else needed to support macro expansion if used, etc. etc. The beauty of an approach like this is you get VFP's interpreter/compiler to do the checking for you - you don't have to implement your own syntax parser.

Another approach might be to implement syntax parsing/checking for all of the SQL "Critical Changes" in the VFP8 docs. This would have the advantage that you wouldn't have to provide environment(s) to actually try to run the SQL statements, but you'd have to be very sure you got it right. Handling macro expansion etc. would still be a problem. Also, if MS put in a behaviour change that wasn't documented, you couldn't implement a check for it in your parser so it's conceivable something could slip by that would only be picked up at runtime.

If you need to manually search through an entire project, the GoFish utility works well: GoFish.app v3.0 Global String Search/Edit/Replace File #9925
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform