...

View Full Version : Query Conn...



The Wizzard
02-03-2003, 12:02 AM
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

raven
02-03-2003, 09:08 AM
strSQL = "SELECT * FROM " & Request.QueryString("CarID") & " WHERE.........."

should work fine.

whammy
02-04-2003, 02:58 PM
That seems like a strange way to do it - aren't you using a relational database? :confused:

The Wizzard
02-04-2003, 11:47 PM
Well, im a strange guy... :D

Actually, im interested in the easiest way... I just assumed querystrings might be easiest...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum