Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not closing connection - implications? 1

Status
Not open for further replies.

Glasgow

IS-IT--Management
Jul 30, 2001
1,669
GB
I have just loaded some updates to a web site (with MySql database) and have regularly been experiencing the error:

ADODB.Recordset.1 (0x80004005)
SQLState: 37000 Native Error Code: 0 [DataDirect][ODBCCUR lib] Syntax error or access violation

The error (which occurs on various ADO recordset .Update lines throughout the code) is not easy to replicate but usually happens after a few database updates have completed successfully.

On investigation of code (both old and new), I noticed several places where a connection was Set = Nothing but the connection was not closed beforehand. Might this be the culprit? Does anyone know the usual implications of such an omission - i.e. not closing the connection? I have now inserted .Close where appropriate and have my fingers firmly crossed.

Since the web site has been active (about 18 months) we have also had occasional 'Bad Gateway' errors. Might these be triggered by the same coding error? I gave up trying to pursue this with the ISP who hinted that they could be down to bad scripting.

Thanks in advance.
 
Not certain if this is exactly what is causing your issue, but MS indicates that not doing so could cause problems. (See Close and Set Your ADO Objects to Nothing As Soon As Possible).

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Thank you. Agreed, it certainly implies as much - I wish they were a little more specific - e.g. the kind of failure/error that could be anticipated when you forget to do this.

I hope I have eliminated the main error now but I need to test more. The Bad Gateway errors continue but I believe they are probably down to the ISP.

Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top