Thanks very much Bob for helping me out.
My problem was that the "shortuser" variable was derived from:
Request.ServerVariables("AUTH_USER")
This returns a null in IIS 6 (but not IIS 5) and, as you pointed out,
because my parameter was not delimited, caused the error.
Thanks again for your help.
Dave
PS.
I have never seen a stored proc executed in the manner you showed (as a
property of a connection object):
cn.usp_Sp_GetConsultInfo shortuser, rs
How long have we been able to do this?
"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Od**************@TK2MSFTNGP10.phx.gbl...
Dave F wrote: Thanks Guys.
The offending line is:
rs.Source=sSql
I re-wrote the code as below but am still getting the error:
'open connection (defined in db_cn.asp include)
cn.open
'Get specified record:
sSQL = "usp_Sp_GetConsultInfo"
sSQL = sSQL & " @logon = " & shortuser
Look at the result of:
response.write sSQL
If @logon is a character parameter, then this line should have failed in
IIS5 since you did not delimit the parameter value.
Instead of that dynamic sql, I suggest using the following to execute your
procedure:
cn.usp_Sp_GetConsultInfo shortuser, rs
Now you no longer have to worry about delimiters or SQL Injection.
Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"