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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

type mismatch error: asp and oracle stored procedure using parameters

Status
Not open for further replies.

josephsiah

Programmer
Nov 22, 2002
4
US
Can someone please help me with the following code? I am getting the following error message:

Error Type:
Provider (0x80020005)
Type mismatch.


ASP CODE:

Dim objCmd_lb
Dim txtHin, txtYearBuilt, txtCertNumber, v_PassFormatCheck

txtHin = Request.Form("txtHIN")
txtYearBuilt = Request.Form("txtYearBuilt")
txtCertNumber = Request.Form("txtCertNumber")

'-- Create new command object
Set objCmd_lb = Server.CreateObject("ADODB.Command")
objCmd_lb.ActiveConnection = Connection()
objCmd_lb.CommandText = "Wrd_dba.VALIDATIONHIN"
objCmd_lb.CommandType = adCmdStoredProc

'On Error Resume Next

objCmd_lb.Parameters.Append = objCmd_lb.CreateParameter("V_HIN", adVarChar, adParamInput, txtHin)
objCmd_lb.Parameters.Append = objCmd_lb.CreateParameter("V_YearBuilt", adInteger, adParamInput, txtYearBuilt)
objCmd_lb.Parameters.Append = objCmd_lb.CreateParameter("v_CertificateNumber", adVarChar, adParamInput, txtCertNumber)
objCmd_lb.Parameters.Append = objCmd_lb.CreateParameter("v_PassFormatCheck", adInteger, adParamOutput)


objCmd_lb.Execute

v_PassFormatCheck = objCmd_lb.Parameters("V_PassFormatCheck")


Stored Procedure:
CREATE OR REPLACE PROCEDURE ValidationHin (
V_Hin IN varchar2,
V_YearBuilt IN OUT number,
v_CertificateNumber IN varchar2,
v_PassFormatCheck OUT number)
 
This line produces the error:
objCmd_lb.Parameters.Append = objCmd_lb.CreateParameter("V_HIN", adVarChar, adParamInput, txtHin)

When I comment out the line, the error moves to the next line.

Also, I have tried it out with the following code and I still get the same error message.

objCmd_lb.Parameters.Append = objCmd_lb.CreateParameter("V_Hin", adVarWChar, adParamInput, "RNGDNRLBL707")

 
Are the ADO constants defined somewhere else in the code?

[adInteger, adVarChar, adParamInput etc...]
 
Yes. The ado constants are in the adovbs.inc file. I have a line on the page as follows:

<!-- #include virtual="/assets/inc/adovbs.asp" -->
<%
Dim strFieldValue
Dim dicFields 'dictionary for failed fields
Dim blnFieldIsOkay
 
Here is another thing that I notice:

When I remove the call to the stored procedure and have a line like this,

objCmd_lb.CommandText = ""

I still receive the type mismatch error. Could it be my connection to the database or stored procedure?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top