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!

Calling stored procedure from ASP page!

Status
Not open for further replies.

z07924

IS-IT--Management
Feb 18, 2002
122
0
0
GB
set cn = server.CreateObject("ADODB.Connection")
set cmd = server.CreateObject("ADODB.Command")


cn.Open Application("Connection")
set cmd.ActiveConnection = cn

cmd.CommandType = adCmdStoredProc
cmd.CommandText = "Sp_ContactList"
cmd.Parameters.Refresh


cmd.Parameters(1) = Session("LoginID")
cmd.Parameters(2) = strContactName
cmd.Parameters(3) = strContactEmail

cmd.Execute lngRows, , adExecuteNoRecords

lngRetValue = cmd.Parameters(0)

'error handling......

if isempty(lngRetValue) or lngRetValue <> 0 then 'errors occured
if isObject(cn.Errors) and cn.Errors.Count > 0 then ' errors from db server
strErrMsg = cn.Errors(cn.Errors.Count - 1).Description
else ' other errors
strErrMsg = Err.Description
end if
end if




Getting error in the below line.
cmd.CommandType = adCmdStoredProc

the error is given below,

Error Type:
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/HitDev/SaveDetails.asp, line 51

Could u please let me know, what kind of error is this?...

I have no idea. I am just calling a stord procedure from the asp page passing 3 parameters.

Thanks,
laks
 
Here's one description of the error:


[sup]
user.gif

There's never time to do it right, but there's always time to do it over!

[/sup]
 
Try checking the length of the values you are using to populate the Command Object parameters. This error can occur if they are longer than the length specified in the Stored Procedure definition itself.

I myself have been caught out by this problem in the past when a particularly long email address was passed to a Stored Procedure parameter.

The path to freedom is seldom trodden by the multitude.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top