[thelist] Pass ASP query string to SQL statement

Joel D Canfield joel at streamliine.com
Fri Aug 10 17:57:07 CDT 2007

> <%
> vidid = request.querystring("id")
> MY_STRING = "Driver={Microsoft Access Driver (*.mdb)};DBQ=\videos.mdb"
> Server.ScriptTimeout = 180
> Dim videos
> Set videos = Server.CreateObject("ADODB.Recordset")
> videos.ActiveConnection = MY_STRING
> videos.Source = "SELECT * FROM videos where active=Yes and Id 
> ='" & vidid &
> "'"
> videos.CursorType = 1
> videos.CursorLocation = 1
> videos.LockType = 1
> videos.Open()
> %>

First, check your connection info here:


Carl's got it pretty much laid out.

Second, I also suspect that you want single quotes around the text value
'Yes' but not around the numeric value vidid.

Check those two things, and if it still ain't workin' maybe I'll
resurrect some of my Access access (1) info and try to be more helpful.


(1) Long before the stupid idea of naming their web browser the same as
their operating system navigation, the folks from Redmond thought they
should name the tools in their office suite with regular old words from
the English language which make for some ridicilous sentences. "I can't
access Word, but I excel at Access. My outlook is good, even though I
can't access Outlook and don't excel at it."

More information about the thelist mailing list