Click to See Complete Forum and Search --> : SQL query help please shou;ld be easy but im stuck
Johnny23
Apr 8th, 2001, 04:06 PM
Ok i have a ComboBox on an asp form with three different values in it the values represent table names in my database
ie
LEvelOne
LevelTwo
LevelThree
i want my statement to
"Select * from " & "Combobox"
Select* data from the name of the table????
can this be done and how please im stuck on it???
hellswraith
Apr 8th, 2001, 07:35 PM
When you click submit, your combobox is going to pass the selection. Create a variable to hold that selection, and put that variable in the SQL statement for the table. You would have to make a string variable to hold your SQL statement.
Or you could have 3 different SQL statements and use an if statement to decide which one to use by compairing the selected item in the combo box. This would be bad programming though, because you couldn't easily add more table selections in the future.
Stick with the first way if I were you.
Hope that helps.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.