aa said:
Thnanks, Bob
I run the query in ASP using:
objCom.CommandText=QueryName & "'" & param1 & "'," & "'" & param2 &"'"
Your passing both of your parameters as strings - isn't one of them supposed
to be a number? Do not delimit numeric parameters.
set objRS(3)=objCom.Execute
Why do you have "objRS(3)"?
Do you have an array containing recordset objects?
It is param2 which is passed to the query as param.
Please note that this has been working fine before I added the sqr()
Instead of using the Command object, do this:
Set objRS = server.createobject("adodb.recordset")
objConn.QueryName param1,param2,objRS
or, if you really do have an array containing your recordset objects:
Set objRS(3) = server.createobject("adodb.recordset")
objConn.QueryName param1,param2,objRS(3)
If you still get the type mismatch, explicitly cast the parameter variables
to the proper datatypes (CInt and CDbl are for the sake of example - I don't
know what datatypes are needed in your query):
Set objRS = server.createobject("adodb.recordset")
objConn.QueryName CInt(param1),CDbl(param2),objRS
Of course, you still need to make sure the parameters in your query have the
proper datatypes in your PARAMETERS statement.
Another thing to be aware of is that the sqr() may be resulting in a new
datatype which will not be correct in the final result. I doubt that this is
the case, because this situation usually leads to an "arithmetic overflow"
error rather than a type mismatch.
Bob Barrows