Hi,
During a few days we keep getting the following errors on our site:
Microsoft VBScript runtime error '800a01fb'
An exception occurred: 'Open' /poll/polls.asp, line 102
Microsoft VBScript runtime error '800a01fb'
An exception occurred: 'Open'
/evenementen/show_events.asp, line 45
The site has been running for a month or so. After refreshing the page the content is vissible again, refresh gives error and this is shown random.
The provider says that this is because of a none closing of a database.
Some source codes:
Global.asa
show_events.aspCode:<OBJECT RUNAT="Server" SCOPE="Application" ID="conquerChatUsers" PROGID="Scripting.Dictionary"> </OBJECT> <OBJECT RUNAT="Server" SCOPE="Application" ID="conquerChatRooms" PROGID="Scripting.Dictionary"> </OBJECT> <OBJECT RUNAT="Server" SCOPE="Application" ID="conquerChatMessages" PROGID="Scripting.Dictionary"> </OBJECT> <SCRIPT LANGUAGE="VBScript" RUNAT="SERVER"> Sub Session_OnStart Dim d d = Date Application.Lock Session("active") = Request.Cookies("Forum")("ID") Application("currentUser") = Application("currentUser") + 1 Application("allUser") = Application("allUser") + 1 Application.UnLock if Application("lastupdated") <> d then Application.Lock Application("lastupdated") = d Application("totalvisitors") = 1 Application("visitorsonline") = 1 Application.Unlock end if End Sub Sub Session_OnEnd Application.Lock Application("currentUser") = Application("currentUser") - 1 Application.UnLock End Sub Sub Application_OnStart Dim cnString cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/producten.mdb") Application("Producten") = cnString cnString = "" cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/evenementen.mdb") Application("Evenementen") = cnString cnString = "" cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/rally.mdb") Application("Rally") = cnString cnString = "" cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/bestellingen.mdb") Application("Bestellingen") = cnString cnString = "" cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/agenda.mdb") Application("agenda") = cnString cnstring = "" cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/forumdb.mdb") Application("ASPForumDSN") = cnString cnstring = "" cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/sociaal.mdb") Application("sociaal") = cnString cnstring = "" cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/provinciedata.mdb") Application("provincie") = cnString cnstring = "" cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/aanmeldingen.mdb") Application("aanmeldingen") = cnString cnstring = "" cnString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("/_private/dementiepoll.mdb") Application("dementiepoll") = cnString Application("currentUser") = 0 Application("allUser") = 0 Call SetTheme End Sub Sub SetTheme Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open Application("ASPForumDSN") SQL = "SELECT * " SQL = SQL & "FROM Board_Prefs " Set boardRs = Conn.Execute(SQL) Application("ForumsName") = Replace(boardRs("board_name"),"`","'") Application("URLLocation") = boardRs("board_url") Application("BoardHome") = boardRs("board_home") Application("PageShow") = boardRs("board_page") Application("BoardHTML") = boardRs("board_html") Application("SupportEmail") = boardRs("board_support") Application("dateAfter") = boardRs("board_date_after") Application("Defaultview") = boardRs("board_view") boardrs.close set boardrs = Nothing conn.Close set conn = Nothing End Sub </SCRIPT>
functions.asp just a small partCode:<%@ Language=VBScript %> <% Option explicit Response.Buffer = True Session.timeout = 30 %> <!-- #include file = "../include/functions.asp" --> <% dim EventID EventID = int(request.querystring("id")) %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="../include/alzheimermodern.css" TYPE="text/css"> <link rel="stylesheet" href="evenementen.css" TYPE="text/css"> <!-- #include file = "../include/functions.js" --> </head> <body> <% dim sQry1 dim sQry2 dim rsEvent dim rsSponsors dim dbEvent dim strFoto1 dim strFoto2 dim strOmschrijvingKort dim strOmschrijvingLang dim objFSO dim strSponsorLogo dim strSponsorNaam dim strSponsorWebsite Set objFSO = Server.CreateObject("Scripting.FileSystemObject") set dbEvent = OpenDSN("evenementen") sQry1 = "Select * from tb_evenementen WHERE ID=" & EventID set rsEvent = Server.CreateObject("ADODB.Recordset") rsEvent.Open sQry1, dbEvent,1,1 if not rsEvent.EOF Then Response.Write "<p> </p>" Response.Write "<p align=""left""><font size=""3""><b class=""txt-kop"">" & rsEvent("titel") & "</b></font><font size=""3""></b></font></p>" Response.Write "<p> </p>" Response.write "<table width=""100%"" border=""0"" cellspacing=""5"" cellpadding=""5"">" do until rsEvent.EOF strFoto1 = rsEvent("foto1") strFoto2 = rsEvent("foto2") strOmschrijvingKort = replace(rsEvent("omschrijving_kort"), vbcrlf, "<BR>") strOmschrijvingKort = replace(strOmschrijvingKort, "<" & chr(37), "") strOmschrijvingKort = replace(strOmschrijvingKort, chr(37) & ">", "") strOmschrijvingLang = replace(rsEvent("omschrijving_lang"), vbcrlf, "<BR>") strOmschrijvingLang = replace(strOmschrijvingLang, "<" & chr(37), "") strOmschrijvingLang = replace(strOmschrijvingLang, chr(37) & ">", "") if strFoto1 <> "" Then Response.write "<tr bgcolor=""#E6EDE3""><td><img src=""upload\"&strFoto1&""" width=""250"" id=""floatleft""><b>" & strOmschrijvingKort & "</b></td>" & vbCrLf Else Response.write "<tr><td><b>" & strOmschrijvingKort & "</b></td>" & vbCrLf End If Response.write "</tr>" & vbCrLf if strFoto2 <> "" Then Response.write "<tr bgcolor=""#E6EDE3""><td><img src=""upload\"&strFoto2&""" width=""250"" id=""floatright"">" & strOmschrijvingLang & "</td>" & vbCrLf Else Response.write "<tr><td><b>" & strOmschrijvingLang & "</b></td>" & vbCrLf End If Response.write "</tr>" & vbCrLf rsEvent.Movenext loop response.write"</table></td>" & vbCrLf Else Response.Write "<p> uitgebreide omschrijving is niet gevonden, probeer het later nog eens! </p>" & vbCrLf end if rsEvent.Close set rsEvent = Nothing CloseDbaseConnection(dbEvent) sQry1 = "Select * from tb_sponsors WHERE evenement_id=" & EventID & " ORDER BY ID" set rsSponsors = Server.CreateObject("ADODB.Recordset") rsSponsors.Open sQry1, dbEvent,1,1 if not rsSponsors.EOF Then Response.Write "<p> </p>" Response.Write "<p align=""left""><font size=""3""><b class=""txt-kop"">Dit evenement wordt gesponsord door:</b></font><font size=""3""></b></font></p>" Response.write "<table width=""100%"" border=""0"" cellspacing=""5"" cellpadding=""5"">" do until rsSponsors.EOF Response.write "<tr>" & vbCrLf Response.write "<td bgcolor=""#E6EDE3"" align=""center"" valign=""middle"">" & vbCrLf strSponsorLogo = rsSponsors("logo") strSponsorNaam = rsSponsors("naam") strSponsorWebsite = rsSponsors("website") if strSponsorLogo <> "" Then Response.write "<A HREF=""<A href="http://"&strSponsorWebsite">HTTP://"&strSponsorWebsite&""" target=""_new""><img src=""upload\"&strSponsorLogo&""" border=""0"" width=""185""></A>" & vbCrLf Else Response.write "<A HREF=""<A href="http://"&strSponsorWebsite">HTTP://"&strSponsorWebsite&""" target=""_new"">"&rsSponsors("naam")&" </A>"& vbCrLf End If Response.write "</td></tr>" & vbCrLf rsSponsors.Movenext loop response.write"</table></td>" & vbCrLf end if rsSponsors.Close set rsSponsors = Nothing CloseDbaseConnection(dbEvent) %> <table id="cel-maintable" class="cel-maintable"> <tr> <td id="cel-credits" class="cel-credits"> © <script language="JavaScript"> <!-- var date = new Date(); var yy = date.getYear(); var year = (yy < 1000) ? yy + 1900 : yy; document.write(year); //--> </script> </td> </tr> </table> </body> </html>
When I'm looking at the other asp pages I can't see where I'm leaving a database connection open.Code:<% Function GetThreadstart(mID) dim strSql dim rsMessages dim strID Set rsMessages = Server.CreateObject("ADODB.RecordSet") strSql = "SELECT Message_ID,replytoid FROM Messages WHERE Message_ID=" & mID rsMessages.Open strSql,Conn,1,1 if not rsMessages.EOF Then do until rsMessages.EOF If rsMessages(1) = 0 Then strId = rsMessages(0) GetThreadstart = strID exit function Else strID = GetThreadstart(rsMessages(1)) end if rsMessages.Movenext loop End if rsMessages.Close Set rsMessages = Nothing GetThreadstart = strID End Function Function GetThreadMessage(mID) dim strSql dim rsMessages dim strIDs Set rsMessages = Server.CreateObject("ADODB.RecordSet") strSql = "SELECT message_ID,replytoid FROM Messages WHERE ReplyToID=" & mID rsMessages.Open strSql,Conn,1,1 if not rsMessages.EOF Then Do until rsMessages.EOF strIds = strIds & "," & rsMessages(0) strIds = strIds & GetThreadMessage(rsMessages(0)) rsMessages.MoveNext loop End if rsMessages.Close set rsMessages = Nothing GetThreadMessage = strIds End Function Function OpenDSN(dsn) dim Conn Set Conn = Server.CreateObject("ADODB.Connection") Conn.Open Application(dsn) Set OpenDSN = Conn End Function Function CloseDbaseConnection(Connection) Connection.Close set Connection = Nothing End Function Function DateFixe (dte) dim minutes minutes = minute(dte) If Len(minutes) = 1 Then minutes = "0" & minutes End If DateFixe = day(dte) & "-" & month(dte) & "-" & year(dte) & "/ " & hour(dte) & ":" & minutes End Function
I can see that the provider is still using MDAC 2.5 could this becausing these errors?
I'm also running the site on my private server at home wich is IIS6 and w2k3 I can't repeat the error there. The site looks to be running fine there.
Please anyone an idea?
Arjan




Bookmarks