Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

editable query

Status
Not open for further replies.

rommeltm00

Programmer
Feb 16, 2006
56
PH
hello guys

can i edit query at runtime

inside fox i can edit it using

vfile=cquery
MODIFY QUERY &vfile

how about when the program is standalone executable
 
No, you can't do that. If you include MODIFY QUERY in a free-standing executable, you'll get a "feature not available" message.

If you want to give your users the ability to create and edit queries, you'll find several third-party components that can do that. Stonefield Query is definitely worth a look (
Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Alternatives to such a poweruser interface are, you make use of parameterized views and let the user enter parameter values. Or even make use of macrosubstitution and use that eg in a where clause or in the field list.

SELECT &lcFields FROM sometable WHERE &lcWhere

You can use macrosubstitution anywhere, you can even do &lcSQL with a user entered SQL string, as long as you can trust the user's input.

If going that route, you would at least ensure the command has no syntax error and better yet, it's not an sql injection, that is a command that will do something else but sql, eg cause an error enabling debugging, decompiling, stealing data, destroying data.

If you are the user, you can trust the entered sql like you can trust any code of yours, of course <s>.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top