I am wondering if I am closing/cleaning up a connection properly.
I have found that over time this functions gets into trouble. First it gets slow, after I while I get "unrecognized database format" and other nasty messages. The database itself is not corrupted
If I close the application and start over again it still does not work. When everyone logges of for the night, it works again the next morning until it again gets into trouble. If think I "max out" the connections or something like that.
Is it sufficient to have .close or do I need to add a
"set something to = Nothing" somewhere?
How would I add a "nothing" line in the statement below?
This Is my code
I use a pass-through query, that stores the connection string, and modify the sql with the code above.
The Stored Procedure is just a basic select statement:
I have found that over time this functions gets into trouble. First it gets slow, after I while I get "unrecognized database format" and other nasty messages. The database itself is not corrupted
If I close the application and start over again it still does not work. When everyone logges of for the night, it works again the next morning until it again gets into trouble. If think I "max out" the connections or something like that.
Is it sufficient to have .close or do I need to add a
"set something to = Nothing" somewhere?
How would I add a "nothing" line in the statement below?
This Is my code
Code:
Private Sub cmdOpenRGliste_Click()
On Error GoTo err_rgliste
With CurrentDb.QueryDefs("qry_conn_RGAccountListe_verdi")
.SQL = "exec dbo.SP_rgListe @rgID = " & Forms!tblsplash.txtrgID & ";"
.Close
End With
DoCmd.OpenForm "frmRGlisteMain"
Exit Sub
err_rgliste: MsgBox Error$
Exit Sub
End Sub
I use a pass-through query, that stores the connection string, and modify the sql with the code above.
The Stored Procedure is just a basic select statement:
Code:
SELECT * from dbo.tbl_account where dbo.tbl_account.rgID = @rgID