|
-
May 20th, 1999, 12:57 AM
#8
New Member
Example for using Stored Procedure with ADO:
-----------------------
Dim Cmd As New ADODB.Command
Dim RS As New ADODB.Recordset
Dim Prm As New ADODB.Parameter
'Assume you have a connection 'adoConnection'
Set Cmd.ActiveConnection = adoConnection
Cmd.CommandType = adCmdStoredProc
'Name of the Stored Procedure
Cmd.CommandText = "FYIADM.CUR_CWC.CWC_INSERT"
Prm.Name = "ObjectType"
Prm.Type = adVarChar
Prm.Size = 15
Prm.Value = Null
Cmd.Parameters.Append Prm
Set Prm = New ADODB.Parameter
Prm.Name = "CUR_FKEY"
Prm.Type = adNumeric
'Prm.Size = 15
Prm.Value = lngFkey
Cmd.Parameters.Append Prm
Set Prm = New ADODB.Parameter
Prm.Name = "CUR_DKEY"
Prm.Type = adNumeric
Prm.Size = 15
Prm.Value = lngDkey
Cmd.Parameters.Append Prm
Set Prm = New ADODB.Parameter
Prm.Name = "Owner"
Prm.Type = adVarChar
Prm.Size = 30
Prm.Value = pstrOwner
Cmd.Parameters.Append Prm
Set Prm = New ADODB.Parameter
Prm.Name = "EndDate"
Prm.Type = adDate
'Prm.Size = 15
Prm.Value = pdtEndDate
Cmd.Parameters.Append Prm
'Execute the procedure
Set RS = Cmd.Execute
If Not RS.EOF Then
End If
Set Prm = Nothing
Set RS = Nothing
Set Cmd = Nothing
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
|