Forum Moderators: open
[Microsoft][ODBC Microsoft Access Driver] Syntax error in string in query expression 'id = ''.
/nybygge/community_1_/whois.asp, line 19
____________________________________
here is whois.asp around that lines:
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("members.mdb")&";pwd=pwd"
Set RecSet = Server.CreateObject("ADODB.Recordset")
Addera = "SELECT * FROM members where id = '" & Request.QueryString("checkid") '<----line 19
Can someone help me out with this?!
/Rigg
You do have Syntax Errors in your SQL string,
If CheckID is a number field
"SELECT * FROM members where id = " & cint(Request.QueryString("checkid")) & ";"
(do the cint just to be sure)
Or If CheckID is a Text Field
"SELECT * FROM members where id = '" & Request.QueryString("checkid") & "';"
In both cases you need the ; at the end.
I think that should fix the problem.
Onya
Woz
Cat it some problems with the session("id")? The link leading to this is for a user to change his settings:
<a href="whois.asp?id=<%=Request.QueryString("id")%>&change=yes&checkid=<%=Session("id")%>
Another link, just to read the settings on any user is:
<a href="whois.asp?checkid=<%=RecSet("ID2")%>
and that one never fails!
G.
dim sId
sId= val(Request.QueryString("checkid"))
if sId = 0 then
'error invalid id
end if
Addera = "Select * From members Where id = " & cstr(sId)
This is my third free host and this happened a lot more on the prvious two. I've never had the error on my own IIS or in 3 years at work