Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Parameter Type

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Ok, this is the portion of my asp that is not working.
Nouman, helped with this code and other another one
which is now working but this one is not.
I keep getting this error:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
[Microsoft][ODBC driver for Oracle]Invalid parameter type
/mydb/GetSubmitResult.asp, line 38

Line 38 is this:
objRs.Open objCmd

Here is the entire code.
Any help would be appreciated.
Thanks in advance.
sim

<% Language=VBScript %>
<html>
<head>
<meta NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual
Studio 6.0&quot;>
</head>
<body>

<%

const ArraySep = &quot;,&quot;
Dim objConn,objCmd,objRS
Set objConn =server.CreateObject(&quot;ADODB.Connection&quot;)
Set objCmd= server.CreateObject(&quot;ADODB.Command&quot;)
Set objRs=server.CreateObject(&quot;ADODB.Recordset&quot;)

objConn.CursorLocation = 3
objConn.Open &quot;DSN=mydb;UID=scott;PWD=tiger&quot;

objRs.CursorLocation = 3
objRs.CursorType = 3
objRs.LockType = 4

dim StRaData , StData
StRaData = Request.Form(&quot;txtData&quot;) & ArraySep
StData = Split(straData, ArraySep )

With objCmd
.CommandType = &H0004
.ActiveConnection = objConn
.CommandText = &quot;stp_TEST_GetCV&quot;
.Parameters.Append .CreateParameter(&quot;P_FirstName&quot;,200, &H0001, 20, stData(0))
.Parameters.Append .CreateParameter(&quot;P_LastName&quot;,200, &H0001, 20, stData(1))
.Parameters.Append .CreateParameter(&quot;P_Phone&quot;, 200,&H0001, 20, stData(2))

End With

objRs.Open objCmd

Set objCmd=nothing
Set Conn = nothing

%>


<TABLE cellSpacing=0 cellPadding=10 width=&quot;58%&quot;
border=1

align=&quot;center&quot;>

<TR>
<TD align=middle>
CV Search Result
</TD></TR>
<TR>
<% If Not objRs.EOF And objRs.BOF Then
While not objRs.Eof %>
<TR><TD><%= objRs.Fields(1).value%></TD></TR>
<TR><TD><%= objRs.Fields(2).value%></TD></TR>
<TR><TD><%= objRs.Fields(3).value%></TD></TR>
<TR><TD><%= objRs.Fields(4).value%></TD></TR>
<% obRs.moveNext
Wend
else
response.write stData(0) & stData(1) & stData(2) %>
<TR><TD> No Records Found...</TD></TR>
<% end if
objRs.close
Set objRs=nothing
%>

</TR>

</TABLE>
</body>
</html>
 
make sure the variables you are passing in to the stored procedure are not blank or null. You should check your variables before passing them in. Also make sure that the data type set in the stored procedure is the same as the format you are passing the variables in as.
 
Thanks sjravee.
Now I am getting a new error that says:
operation cannot be peformed when object is closed.
This error is :
>
<% If Not objRs.EOF And objRs.BOF Then
While not objRs.Eof %>
 
dont set objCmd=nothing and dont Set Conn = nothing until you completed your loop code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top