-
I have a data environment (dataenvironmet1) that runs a sql query and posts the results to a data grid. My question is after that query has been ran (command1) how do you close the connection? For example, if I run the query and get the results and then try to run another query it will give me the message
Run Time error 3705
"Operation is not allowed when object is open"
I am supposing that all I have to do is close the connection. I understand how to do when using ADO but I have no clue with a dataenvironment.
Thanks
-
'PRINT SHIFT REPORTS
With DE1 ' MY DATA ENVIRONMENT
'CLOSE CONNECTION
If .rsdrFindPayroll.State = adStateOpen Then
.rsdrFindPayroll.Close
End If
'SET QUERY PARAMETER
MSHFlexGrid1.LeftCol = 0
'OPEN CONNECTION
.drFindPayroll MSHFlexGrid1.Text
'SHOW PAYROLL REPORT
drPayroll.PrintReport
End With
-