Alex said:
rs.Source = "SELECT * FROM courseReg WHERE (((courseReg.CourseID) = "
& StrRecid & ")) "
rs.CursorType = 0
Microsoft JET Database Engine error '80040e14'
Extra ) in query expression '(((courseReg.CourseID) = ))'.
update.asp, line 26
I know i pass the correct value i just don't understand
why this code giving problems.
It's pretty obvious that StrRecid does not contain what you think it
contains. And here is why:
Recid = Request.QueryString("qryCategory")
Response.redirect "update.asp?" & Recid
You did not name the querystring variable in the redirect statement. It
should be:
Response.redirect "update.asp?rec=" & Recid
To help you better debug these things, never assign a concatenated string
directly to an object's property. Always assign it to a variable, and
subsequently use the variable in the code. This will allow you to write the
variable to the response to see what it contains. Like this (I'm getting rid
of those unneeded and confusing parentheses):
sSQL="SELECT * FROM courseReg WHERE courseReg.CourseID = "
sSQL = sSQL & StrRecid
'the following lines can be commented or deleted after debugging is done
'*******************************************
Response.Write sSQL
Response.End
'*******************************************
'it looks like you are opening a default cursor, so only one
'line is needed (you don't even need the "set rs=createobject" line):
set rs = conn.execute(sSQL,,1)
You only need to explicitly create and set the recordset's properties if you
need something other than the default, server-side, forward-only cursor.
HTH,
Bob Barrows