Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Execute an SQL statement that is stored in a String?
Message
From
26/10/1999 17:55:15
 
 
To
23/10/1999 21:50:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00280480
Message ID:
00281899
Views:
14
>
>You may collect the string(s) and then execute, e.g.
>cFieldstring="field1,fieldx"
>cFromstring="mytable"
>cWherestring="field1='qwerty'"
>cOrderstring="2"
>Select &cFieldstring. From &cFromstring. Into Cursor mycursor Where &cWherestring. Order by &cOrderstring.


Mauricio, the approach that Edward is suggesting is a good way to go. Note that there is a 256 (?) character limit on each macro expansion. That's why it's very helpful to devide up the various parts of the syntax.

I didn't understand this work around and so I wound up writing a number of different SQL statements which I choose with a case statement. Works OK, but the approach above is better. I'll redo my search forms some day.

Peter Robinson
Peter Robinson ** Rodes Design ** Virginia
Previous
Reply
Map
View

Click here to load this message in the networking platform