[thelist] Re: (apparently) Unclosed database connections
Bruce MacKay
b.mackay at massey.ac.nz
Sat Jul 19 06:23:58 CDT 2003
Thanks folks for the responses.
An error message which I've rightly/wrongly associated with the onset of
server lockup is of the form....
Microsoft VBScript runtime error '800a01fb'
An exception occurred: 'open'
/studyhome.asp, line 50
I googled this message tonight and the few answers available also mentioned
MDAC version
For completeness,
studyhome.asp....
================================
call sbMakeAConnection(csMainDatabase,1)
sqlstring = "SELECT messageID FROM messages WHERE
(receiverID='"&studentID&"' AND messagedate > "&fnSQLTime(messageevent)&"
AND message_read=False);"
rs.open sqlstring <-------- line 50
==================================
sub sbMakeAConnection(byVal db,byVal rset1)
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& csDatabasePath
& db & ".mdb"
if rset1=1 then
set rs = Server.CreateObject("ADODB.Recordset")
set rs.ActiveConnection = conn
rs.CursorType = adOpenForwardOnly
rs.LockType = adLockReadOnly
end if
end sub
I set rset to 1 when I'm pulling a recordset from the database, 0
otherwise. If I read your example correctly Ken, my code structure should
protect me against implicitly opened connections.
Thanks again - will check the MDAC version
Bruce
More information about the thelist
mailing list