Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ADO call with parameter list
Message
De
15/03/2002 10:06:42
 
 
À
15/03/2002 09:27:53
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Divers
Thread ID:
00633371
Message ID:
00633401
Vues:
16
Hi, you have to use parameter object to pass it to command object.
see the code below
'for input parameters
Dim ip_para1 As New ADODB.Parameter
Dim ip_para2 As New ADODB.Parameter

'define input/output parameter(s), if any, types in sync with sql

Set op_rate = cmd.CreateParameter("output", adCurrency, adParamOutput)
cmd.Parameters.Append op_rate
Set ip_para1 = cmd.CreateParameter("input", adInteger, adParamInput)
cmd.Parameters.Append ip_para1
Set ip_para2 = cmd.CreateParameter("input", adVarChar, adParamInput, 4)
cmd.Parameters.Append ip_para2
cmd.CommandText = "YourProcedure"

'assign values to ip paras
ip_para1.Value = CLng(DataCombo1.BoundText)
ip_para2.Value = Text2
'execute you procedure
cmd.CommandType = adCmdStoredProc
cmd.Execute
'cmd(0) wud return value of output para, if any
mrate = IIf(IsNull(cmd(0)), 0, cmd(0))
Best Luck..
Nilesh
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform