var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: ASP parameter passing causing SQL errors
Hi, if anyone can help or point to a forum message which already has an answer to this I'd be grateful.
I've got an SQL query, which is built from numeric parameters passed by a form:
rsSQL = "SELECT COUNT(*) AS count FROM calendar WHERE Year=" & request.form("selYear") & " AND Month=" & request.form("selMonth") & " AND Day=" & request.form("selDay")
However the following will not open the recordset:
DB.Open rsSQL, DB_CONNECTIONSTRING, adOpenStatic, adLockPessimistic
Can anyone advise?! If I change the rsSQL statement to, for example:
rsSQL = "SELECT COUNT(*) AS count FROM calendar WHERE Year=2003"
everything works fine. Grr...
** Update - fixed. Was passing an empty value which caused the problems. A lesson to be learnt for sure...
Last edited by mkaka; 09-16-03 at 08:36.
Set rsSQL = "SELECT COUNT(*) AS 'count' FROM calendar WHERE Year = " & request.form("selYear") & " AND Month = " & request.form("selMonth") & " AND Day = " & request.form("selDay") & ""