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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to recreate VFP's query dialog box, & its functionality, in code.

Status
Not open for further replies.

Loomis

Programmer
Jan 4, 2000
31
US
I am creating a user interface (dialog box) that will capture information, from the user, that will be the criteria for a query (select SQL statement). Two questions: since the query criteria are user definable, what is the best way to formulate SQL select statements whose clauses will vary. Secondly, what is the best way to save the query so that it can later be used to repopulate the original dialog box used to create it? Are there any VFP 8 samples that do what I’m attempting? I would think most applications would need this type of functionality since VFP’s built in query capability is not available when developing.
 
Loomis,
It's rare that the "typical" application user can handle the capabilities of a full SQL query dialog. You might be better off checking out some "canned" VFP solutions. Two that come to mind are Stonefield Query at and FoxFire! at For Non-VFP solutions you may want to consider Crystal Reports or R&R Report Writer at Note: CR like Stonefield Query and FoxFire! can also be integrated into a VFP application if you want a more customized front-end.

You could also use Access to attach to the tables using the new VFP OLE DB provider ( or the older (more limited) VFP ODBC client ( and use it's Query tool.

Basically, I'm suggesting that this isn't a trivial exercise!

Rick
 
RGBEAN:
I don't expect users to handle the capabilities of a full SQL query dialog. My query dialog will be more simple and less full featured. However, is there an widely accepted way to take information from a dialog box and construct the corresponding SQL select command. For example, might one take a few bits of info from the dialog box, form the corresponding clause in a SQL select statement, and save the clause to, say, a memo field. Then, repeat this until all the dialog info is in the memo field. Then, from the memo field, form the complete SQL select statement.
 
If you have a specific table (with or without dependent lookup tables) and a limited number of options in mind, it's usually easier to build a custom form. Just add some drop down combos, multi-select list boxes, check boxes and/or option groups and then some text boxes for the variable or filtering data. The biggest problem with "generic" dialogs, is that unless you use a true data dictionary, the user will have trouble with picking the right fields and/or the values that they may have. That's one reason that Stonefield Query and FoxFire! are so "friendly" - you have to do a lot of setup work, before they make it easy for the users!

Rick
 
Loomis

You might consider distributing the wzquery.app module, which is distributable.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike,
While you can use the .APP "as is", I don't believe you can modify it and then use the pieces to build a "better" one (there are parts of the Wizard framework that aren't provided and reverse enginering them would probably violate the EULA). However, I suppose one could attempt to read through the code that is available to see how they did it and build your own.

Rick


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top