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

Ability to build adhoc query

Status
Not open for further replies.

Corinne

Programmer
May 15, 2001
146
0
0
US
I'm trying to add the ability for my clients to create adhoc query's on the fly. I have a form that allows them to build the query by selecting criteria from a series of combo boxes. Within the if statement I'm unsure of how to reference this in code. I'm using VB6.

Thanks
 
I'm not sure I understand your problem.

"Within the if statement I'm unsure of how to reference this in code"

Please explain (briefly), provide the relevant part of your code alsong with an example.

MichaelRed
mred@att.net

There is never time to do it right but there is always time to do it over
 

Carmilita ,
sSQL = "SELECT * FROM YOUR_TABLE " &
"WHERE FIELD1='" & cboCombo1.text & "'" & _
" AND FIELD2 ='" & cboCombo2.Text & "'"

Is this where you were going with this?
 
woyler,

Yes, that was exactally where I was going with that question. Thank you so much for responding to my question.

 
What I do in these cases, where I want the user to create their own queries, is to build a metadata table that includes the statements for the partucular query. You can make it as easy on yourself as you wish, when the user clicks a button, they get a result. Or you can allow them to select fields and add variables, in this case your metadata table will be more complex.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top