Displaying Source Code(s)
|
|
Using a Stored Procedure with ADO
--------------------------------------------------------------------------------
Description : This will connect to your specified Stored
Procedure, refresh the parameters, add each parameter, and then
execute it. Optionally, it has a return value, as a parameter.
This is always useful when inserting, and using @@identity
Dim cn As New ADODB.Connection
cn.Open sConStr
Dim cmd As New ADODB.Command
cn.CursorLocation = adUseClient
Set cmd.ActiveConnection = cn
cmd.CommandText = "addNew_Service"
cmd.CommandType = adCmdStoredProc
cmd.Parameters.Refresh
cmd.Parameters.Item("@wsdlfilename") =
CStr(services(serviceId).wsdlfilename)
cmd.Parameters.Item("@WSMLFileName") =
CStr(services(serviceId).WSMLFileName)
cmd.Parameters.Item("@name") = CStr(services(serviceId).name)
cmd.Parameters.Item("@description") =
CStr(services(serviceId).description)
cmd.Parameters.Item("@uuid") = CStr(sUUID)
cmd.Parameters.Item("@Service_ID") = 0
cmd.Execute
Debug.Print Err.description
newService_ID = cmd.Parameters("@Service_ID").Value
|
|
|