|
-
May 5th, 2005, 06:15 AM
#1
Thread Starter
Hyperactive Member
Re: Return value of Stored Procedure
"Arithmetic overflow converting expression to data type smalldatetime"
I'm using a code which i posted really.
Code:
Parameters.Append .CreateParameter("RETURN", adInteger, adParamReturnValue)
Is return value should be 1st parameter?
-
May 5th, 2005, 06:27 AM
#2
Thread Starter
Hyperactive Member
Re: Return value of Stored Procedure
I have create new stored proc which is requires 1 parameter only (@A)
VB Code:
.Parameters.Append .CreateParameter("@A", adBigInt, adParamInput, , 1)
.Parameters.Append .CreateParameter("@Result", adBigInt, adParamReturnValue)
above code will give me that ""Stored Proc ... has too many agrument specific"
VB Code:
.Parameters.Append .CreateParameter("@Result", adBigInt, adParamReturnValue)
This will give me that " ... @A not supplied"
Am i giving incorrect format?
-
May 5th, 2005, 06:49 AM
#3
Re: Return value of Stored Procedure
I'm pretty sure that the RETURN {int} T-SQL command does not return that value in the PARAMETER collection.
I cannot find backup for this in MSDN - I've got a good ADO book at work that I'll check in 30 minutes...
Why are you so stuck on using RETURN {int} and not simply creating a list of INPUT and OUTPUT parameters? My example showed how to do that quite easily.
The error you keep saying you are getting sounds more like a VB/ADO side error - that the object is not properly created and the SPROC isn't even executing.
BTW - we decided at the start of our development project in VB/ADO/SQL that using LONG (VB) and INT (SQL) was the only integer style we would support. DATETIME also - no small datetime. Supporting lots of different datatypes in the PARAMETER logic is too complex.
-
May 5th, 2005, 07:02 AM
#4
Frenzied Member
Re: Return value of Stored Procedure
 Originally Posted by szlamany
I'm pretty sure that the RETURN {int} T-SQL command does not return that value in the PARAMETER collection.
I cannot find backup for this in MSDN - I've got a good ADO book at work that I'll check in 30 minutes...
Why are you so stuck on using RETURN {int} and not simply creating a list of INPUT and OUTPUT parameters? My example showed how to do that quite easily.
The error you keep saying you are getting sounds more like a VB/ADO side error - that the object is not properly created and the SPROC isn't even executing.
BTW - we decided at the start of our development project in VB/ADO/SQL that using LONG (VB) and INT (SQL) was the only integer style we would support. DATETIME also - no small datetime. Supporting lots of different datatypes in the PARAMETER logic is too complex.
I agree with the OUTPUT parameters idea szlamany - sorry missed that bit in your previous post when I posted this:
 Originally Posted by PilgrimPete
...though I generally lean towards using an output parameter to return data values, and save the adParamReturnValue parameter to return the success (or otherwise) of my proc...
naruponk - the adParamReturnValue parameter has to be the first you add to the parameters collection in the VB code, otherwise you will get the error you report.
-
May 5th, 2005, 07:35 AM
#5
Thread Starter
Hyperactive Member
Re: Return value of Stored Procedure
Ok .... look works
Thanks for ideas & helps guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|