dodgerfan
asked on
Error 3709 in ASP application
I'm getting Error 3709: The connection cannot be used to perform this operation. It is either closed or invalid in this context. I cannot find where this is happening. I've included the code below. Any help is appreciated.
Dim socon as ADODB.Connection: Set socon = dbC
Dim sorec1 As ADODB.Recordset
Set sorec1 = New ADODB.Recordset
Dim cmd As ADODB.Command: Set cmd = New ADODB.Cmd
Dim socomm1 As ADODB..Connection
sorec1.Open socomm1, , , , adCmdText
l_EventID = CLng(g_eventid)
Return_Value = 0
g_CreatorID = CLng(Session("UserID"))
With cmd
Set .ActiveConnection = socon
.CommandText = SP_CREATEFORM
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@Return_ Value", adInteger, adParamReturnValue, , Return_Value)
.Parameters.Append .CreateParameter("@EventID ", adInteger, adParamInput, , l_EventID)
.Parameters.Append .CreateParameter("@Creator ID", adInteger, adParamInputOutPut, , g_CreatorID)
.Execute , , adExecuteNoRecords
End With
Set sorec1 = Nothing
DropCn socon, cmd
Dim socon as ADODB.Connection: Set socon = dbC
Dim sorec1 As ADODB.Recordset
Set sorec1 = New ADODB.Recordset
Dim cmd As ADODB.Command: Set cmd = New ADODB.Cmd
Dim socomm1 As ADODB..Connection
sorec1.Open socomm1, , , , adCmdText
l_EventID = CLng(g_eventid)
Return_Value = 0
g_CreatorID = CLng(Session("UserID"))
With cmd
Set .ActiveConnection = socon
.CommandText = SP_CREATEFORM
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter("@Return_
.Parameters.Append .CreateParameter("@EventID
.Parameters.Append .CreateParameter("@Creator
.Execute , , adExecuteNoRecords
End With
Set sorec1 = Nothing
DropCn socon, cmd
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.