so i tried that code
<%@Language="VBScript"%>
<%
Option Explicit
Dim oRS, oConn, strSQL
Dim i
Dim results
Set oConn = Server.CreateObject("ADODB.Connection")
Set oRS = Server.CreateObject("ADODB.Recordset")
oConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("AddressBook.mdb")
strVar=Request.QueryString("var")
If strVar="all" Then strSQL="select ContactID, Movie, Result ORDER BY Result, Movie asc"
If strVar="film" Then strSQL="select ContactID, Movie, Result WHERE Result = 'film' ORDER BY Movie asc"
If strVar="tv" Then strSQL="select ContactID, Movie, Result WHERE Result = 'tv' ORDER BY Movie asc"
If strVar="portrait" Then strSQL="select ContactID, Movie, Result WHERE Result = 'portrait' ORDER BY Movie asc"
oRS.Open strSQL, oConn, 2, 3
If oRS.EOF Then
Response.Write "success=False"
Else
Do While Not oRS.EOF
results = results & oRS("Movie") & " " & oRS("Result") & ";"
oRS.MoveNext
Loop
results = results & "q"
Response.Write "success=True&results="
End If
oRS.Close
Set oRS = Nothing
oConn.Close
Set oConn = Nothing
Response.Write Server.URLEncode(results)
%>
i get this error
Microsoft VBScript runtime error '800a01f4'
Variable is undefined: 'strVar'
/pk/first2.asp, line 15
|