I have an access database holding 7 tables, I want to be able to search on as many or a little of those fields within those tables and produce results in a datagrid. Is it possible to create an sql query 'dynamically' as the user selects certain criteria or
is there an easier more practical way? I am thinking of using populated dropdown lists for most of the selections, others will have input boxes where the user will enter required values. Thanks
Do you want to possibly use multiple tables at one time in each of your queries? or - - do you want each one of them, individually, to be able to dynamically create queries?
I am not quite sure what you mean, I have 7 tables, 5 of which have attributes that I would like to search on. I would like to be able to search on between 1 and 10 attributes of any of the 5 tables, initially I thought about sub queries, but then maybe one
huge sql query and in the 'where' clause have variables that will equal the values that have been selected or entered by the user. But what about the ones that have not been selected?? The database is for choosing used cars, so a user may want to search for
a car with 5 doors, (MODEL_TYPE TABLE) with an engine between 2000 and 2500 CC (ENGINE TABLE), with automatic transmision (DERIVATIVE TABLE) etc etc. I hope I have explained myself, as without showing my DB structure it's a little difficult. Thanks
luisgc
Member
55 Points
11 Posts
Building an SQL query
Jan 29, 2004 12:14 PM|LINK
augustwind
All-Star
35860 Points
4900 Posts
ASPInsiders
Moderator
Re: Building an SQL query
Feb 02, 2004 04:56 PM|LINK
All Things Dot Net
Stored Procs and Code in a Flash!
ASP.Net Sitemap Creator
luisgc
Member
55 Points
11 Posts
Re: Building an SQL query
Feb 02, 2004 10:19 PM|LINK