I'm trying to pass a null value to my stored proc.
On my asp page, I first deal with the variable like so:
ClassID = IIf(Request("ddlClass"
= "", NULL,Request("ddlClass"
)
I then use the command object to send my params to the stored proc:
Set cmd = CreateObject("ADODB.Command"
cmd.ActiveConnection = conn
cmd.CommandText = "mySP"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("@ClassID",adInteger , adParamInput, , classid)
cmd.Execute
NOTE: There ARE other params that I have left out for simplicity sake. In this case, what works for one works for all.
This, however, gives me no results when I should have X number of rows returned.
I execute the very same stored proc in Query Analyzer like so:
mySP null, 1,3,5
This gives me the result set that I expect to get.
My question: Is there an issue passing null to the database from an asp page being that the variables aren't typed?
I've tried virtually everything I could think of. I just can't seem to get my recordset returned to me... I do, in fact, bind the recordset to the command object to display the results, and my recordcount is always -1
"It's easier to ask forgiveness than it is to get permission." - Rear Admiral Dr. Grace Hopper
On my asp page, I first deal with the variable like so:
ClassID = IIf(Request("ddlClass"
I then use the command object to send my params to the stored proc:
Set cmd = CreateObject("ADODB.Command"
cmd.ActiveConnection = conn
cmd.CommandText = "mySP"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Append cmd.CreateParameter("@ClassID",adInteger , adParamInput, , classid)
cmd.Execute
NOTE: There ARE other params that I have left out for simplicity sake. In this case, what works for one works for all.
This, however, gives me no results when I should have X number of rows returned.
I execute the very same stored proc in Query Analyzer like so:
mySP null, 1,3,5
This gives me the result set that I expect to get.
My question: Is there an issue passing null to the database from an asp page being that the variables aren't typed?
I've tried virtually everything I could think of. I just can't seem to get my recordset returned to me... I do, in fact, bind the recordset to the command object to display the results, and my recordcount is always -1
"It's easier to ask forgiveness than it is to get permission." - Rear Admiral Dr. Grace Hopper