gaudetl
April 18th, 2001, 07:51 AM
I hope someone out there can help me with this. I compiled an application into an exe. The application seems to work fine. When I load the application, I connect to SQL Server then when I close the application, in the unload event of the MDI form, I make sure to disconnect my Connection. Here is my code. Again, no evident problems, the application seems to close.
If Not Cn Is Nothing Then
If (Cn.State = adStateOpen) Then
Cn.Close
Set Cn = Nothing
frmMDI.mnuFileDisconnect.Enabled = False
frmMDI.mnuFileConnect.Enabled = True
frmMDI.mnuFileMainForm.Enabled = False
frmMDI.mnuReportsStaticReport.Enabled = False
frmMDI.mnuReportsAdminReport.Enabled = False
FlagIsConnected = False
End If
End If
However when I logoff my computer. I get the run-time error 3704 "Operation is not allowed when the object is closed". In the task manager after closing my application, I noticed that it is still present. When I try to end task from the Task Manager, I will get this same error.
Please help
If Not Cn Is Nothing Then
If (Cn.State = adStateOpen) Then
Cn.Close
Set Cn = Nothing
frmMDI.mnuFileDisconnect.Enabled = False
frmMDI.mnuFileConnect.Enabled = True
frmMDI.mnuFileMainForm.Enabled = False
frmMDI.mnuReportsStaticReport.Enabled = False
frmMDI.mnuReportsAdminReport.Enabled = False
FlagIsConnected = False
End If
End If
However when I logoff my computer. I get the run-time error 3704 "Operation is not allowed when the object is closed". In the task manager after closing my application, I noticed that it is still present. When I try to end task from the Task Manager, I will get this same error.
Please help