Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4

Thread: Query Conn...

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query Conn...

    I have this code...

    Set objList = Server.CreateObject("ADODB.Recordset")
    strSQL = "SELECT * FROM List WHERE CarID = " & Request.QueryString("CarID")
    objList.Open strSQL, objConection, adOpenStatic, adLockReadOnly, adCmdText

    It gets the info from the querystring "CarID"

    I have multiple tables, and I want to use a querystring to determine what table to connect to...

    Something like this??

    Set objList = Server.CreateObject("ADODB.Recordset")
    strSQL = "SELECT * FROM Request.QueryString("CarID")
    objList.Open strSQL, objConection, adOpenStatic, adLockReadOnly, adCmdText
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)

  • #2
    New Coder
    Join Date
    Jan 2003
    Location
    Peterborough, UK
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    strSQL = "SELECT * FROM " & Request.QueryString("CarID") & " WHERE.........."

    should work fine.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41 8' 52" N -95 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That seems like a strange way to do it - aren't you using a relational database?
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Lake Forest, CA
    Posts
    259
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, im a strange guy...

    Actually, im interested in the easiest way... I just assumed querystrings might be easiest...
    The Wizzard
    OC Motor Cars | OC Auto Sports (Coming Soon!)


  •  

    Posting Permissions

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