Guest_imported
New member
- Jan 1, 1970
- 0
I have memory leakage problem in my MTS. I am using
VB6.0/SQL2k/COM+
This is the snippet of code I am using in one of the
methods in my dll.
I wanted to open and close(release) the connection as
soon as it is done.
But I am getting the error message 'Operation is not
allowed when the object is open.'
in line numbers 10,20,30. I thing there should be a
better way to code.
Any help is highly appreciated.
Thank's alot.
Ami.
Set cnUser = CreateObject("ADODB.Connection"
Set rsUser = CreateObject("ADODB.Recordset"
cnUser.Open "File Name=" & App.Path & mcstrUDLAdminFileName
strSQL = "{call sp1("
strSQL = strSQL & "'" & a & "'"
strSQL = strSQL & "
}"
rsUser.Open strSQL, cnUser
If Not rsUser.EOF Then
intID = rsUser!Id
End If
rsUser.Close
strSQL = "{call sp2("
strSQL = strSQL & b & ""
strSQL = strSQL & "
}"
rsUser.Open strSQL, cnUser
rsUser.Close
strSQL = "{call sp3("
strSQL = strSQL & c & ""
strSQL = strSQL & "
}"
rsUser.Open strSQL, cnUser
10 rsUser.Close
strSQL = "{call sp4("
strSQL = strSQL & d & ""
strSQL = strSQL & "
}"
rsUser.Open strSQL, cnUser
20 rsUser.Close
strSQL = "{call sp5("
strSQL = strSQL & e & ""
strSQL = strSQL & "
}"
rsUser.Open strSQL, cnUser
30 rsUser.close
cnUser.Close
VB6.0/SQL2k/COM+
This is the snippet of code I am using in one of the
methods in my dll.
I wanted to open and close(release) the connection as
soon as it is done.
But I am getting the error message 'Operation is not
allowed when the object is open.'
in line numbers 10,20,30. I thing there should be a
better way to code.
Any help is highly appreciated.
Thank's alot.
Ami.
Set cnUser = CreateObject("ADODB.Connection"
Set rsUser = CreateObject("ADODB.Recordset"
cnUser.Open "File Name=" & App.Path & mcstrUDLAdminFileName
strSQL = "{call sp1("
strSQL = strSQL & "'" & a & "'"
strSQL = strSQL & "
rsUser.Open strSQL, cnUser
If Not rsUser.EOF Then
intID = rsUser!Id
End If
rsUser.Close
strSQL = "{call sp2("
strSQL = strSQL & b & ""
strSQL = strSQL & "
rsUser.Open strSQL, cnUser
rsUser.Close
strSQL = "{call sp3("
strSQL = strSQL & c & ""
strSQL = strSQL & "
rsUser.Open strSQL, cnUser
10 rsUser.Close
strSQL = "{call sp4("
strSQL = strSQL & d & ""
strSQL = strSQL & "
rsUser.Open strSQL, cnUser
20 rsUser.Close
strSQL = "{call sp5("
strSQL = strSQL & e & ""
strSQL = strSQL & "
rsUser.Open strSQL, cnUser
30 rsUser.close
cnUser.Close