Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem passing parameters to SQL server stored proc
Message
De
05/06/2003 11:18:52
Philip Jones
Cornwall County Council
Truro, Royaume Uni
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Problem passing parameters to SQL server stored proc
Divers
Thread ID:
00796748
Message ID:
00796748
Vues:
47
Hi,
Please somebody help me before I have to go out and kill someone's dog with a stick.
I've been struggling with this for ages. Here is the asp code

Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "xxxxx","xxxxx","xxxxxx"

Set Cmd = Server.createObject("ADODB.command")
Set Cmd.ActiveConnection = Conn

With Cmd
.CommandText="testaddress"
.CommandType=adCmdStoredProc
set p = .parameters
p.Append .CreateParameter("@addressid", adNumeric, adParamReturnValue, 18)
p.Append .CreateParameter("@aaaaa", adChar, adParamInput, 40)
p.Append .CreateParameter("@bbbbb", adChar, adParamInput, 30)
Cmd("@aaaaa")="flflflflflflf"
Cmd("@bbbbb")="baaaaaaaaaastard"
.Execute
End With

----------------------

Here is the sql code
-----------------------
PROCEDURE testaddress
@addressid Numeric (18) OUTPUT,
@aaaaa char(40), @bbbbb char(30) -- parameters for address info
AS

INSERT INTO Job (Jo_JobTitle, Jo_SunType) VALUES (@aaaaa, @bbbbb)
-- error handling omitted

SET @addressid = SCOPE_IDENTITY()
GO


---------------------------------------


The problem is this...

p.Append .CreateParameter("@addressid", adNumeric, adParamReturnValue, 18)

cos if I take it out the whole thing works fine.

I keep getting an error message saying "Invalid scale value"

I know that the precision, scale and length of the field in the table are 0, 18, and 9.

What am I doing wrong?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform