W
warway
I get VB error 3709 - The connection cannot be used to perform this
operation. It is either closed or invalid in this context. Stopping at the
Set rs = CMD.Execute line when running the code below:
All I want to happen is for the ShipmentID field in the sp_ShipmentCurrent
recordset to be stored as exisitngShipmentID for future use. I have adapted
the SQL BOL sample but cannot get it to work. Thanks in advance for your
help!
Dim cn As ADODB.Connection
Dim rs As New ADODB.Recordset
Dim Cmd As New ADODB.Command
Set cn = CurrentProject.Connection
Cmd.CommandText = "sp_ShipmentCurrent"
Cmd.CommandType = adCmdStoredProc
Set rs = Cmd.Execute
With rs
existingShipmentID = !ShipmentID
..Update
rs.Close
End With
Warway
operation. It is either closed or invalid in this context. Stopping at the
Set rs = CMD.Execute line when running the code below:
All I want to happen is for the ShipmentID field in the sp_ShipmentCurrent
recordset to be stored as exisitngShipmentID for future use. I have adapted
the SQL BOL sample but cannot get it to work. Thanks in advance for your
help!
Dim cn As ADODB.Connection
Dim rs As New ADODB.Recordset
Dim Cmd As New ADODB.Command
Set cn = CurrentProject.Connection
Cmd.CommandText = "sp_ShipmentCurrent"
Cmd.CommandType = adCmdStoredProc
Set rs = Cmd.Execute
With rs
existingShipmentID = !ShipmentID
..Update
rs.Close
End With
Warway