Results 1 to 2 of 2

Thread: SQL query help please shou;ld be easy but im stuck

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    81

    Unhappy

    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???

  2. #2
    hellswraith
    Guest
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width