This page loads and works fine without the If statement. When the If statement is present, it doesn't get loaded. I'm new to ASP and Access. I think i have the Access part right since, again, the page loads without the if statement. Can anyone figure out what is wrong? Thx.
<% Response.Buffer = True %>
<title>Memeber Email Listing of the chosen zip code</title>
Set rs = Server.CreateObject ("ADODB.Recordset")
rs.Open "members", "DSN=act"
zipwanted = Request.Querystring("zipwanted")
While Not rs.EOF
If rs("zip") = request.querystring("zipwanted") Then
Response.Write "Email : " & rs("email") & "<br>"
Response.Write "Skills : " & rs("skills") & "<br>"
Response.Write "Zip Code : " & rs("zip") & "<br>"
Perhaps my configurationg is wrong somewher, because your code gave this error:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/RH25/listings.asp, line 59
line 59 is: rs.Open SQLx, "DSN=act"
What needs to be done to fix that?
Sorry, in my haste I assumed you had a connection object set up, and just copied and pasted what you had without really thinking...
zw = CStr(Request.Querystring("zipwanted"))
SQLx="SELECT * FROM members WHERE zip='" & zw & "'"
Set Q = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open SQLx, Q
... and then the rest of it...