CLOSE DB connection or set timeout
Hi guys,
I have a website that only pulls data from a DB; there's no inserting a record or carrying over of data. It is a DB that displays the used cars in inventory (and can be sorted to display only be make, year, etc).
My problem is that when a person looks at my webpage a data connection is made. If the person leaves the page open on their computer and then for example, leaves it open all day; when I try to upload an updated DB it knocks out the ASP connection, and then I have to waste time trying to get the connections to close.
Therefore, I think I need a timeout function or something:
My connection file is this:
<%
' FileName="Connection_ado_conn_string.htm"
' Type="ADO"
' DesigntimeType="ADO"
' HTTP="false"
' Catalog=""
' Schema=""
Dim MM_autoaction_STRING
MM_autoaction_STRING = "Driver={Microsoft Access Driver (*.mdb)}; Dbq=********.mdb"
%>
<% Timeout="200" %>
-----------------------------------------------------------------------
Then, the coding on one of the webpages for example, is
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include virtual="/Connections/****.asp" -->
<%
Dim company
Dim company_numRows
Set company = Server.CreateObject("ADODB.Recordset")
company.ActiveConnection = MM_autoaction_STRING
company.Source = "SELECT CompanyName, Address1, Address2, City, ST, Zip, Phone, Fax, Email, Slogan, Hours, WelcomeMsg, GeneralInfo, LocationInfo, lastupdate FROM WebPageInformation"
company.CursorType = 0
company.CursorLocation = 2
company.LockType = 1
company.Open()
company_numRows = 0
%>
<%
Dim detail__MMColParam
detail__MMColParam = "1"
If (Request.QueryString("StkID") <> "") Then
detail__MMColParam = Request.QueryString("StkID")
End If
%>
<%
Dim detail
Dim detail_numRows
Set detail = Server.CreateObject("ADODB.Recordset")
detail.ActiveConnection = MM_autoaction_STRING
detail.Source = "SELECT * FROM WebInventory WHERE StkID = '" + Replace(detail__MMColParam, "'", "''") + "'"
detail.CursorType = 0
detail.CursorLocation = 2
detail.LockType = 1
detail.Open()
detail_numRows = 0
%>
BODY of page...irrelevant...
BUT, to close, I have
<%
company.Close()
Set company = Nothing
%>
<%
detail.Close()
Set detail = Nothing
%>
-------------------------------------------------------------------------
However, this still does not totally close the connection to the DB...
Please can someone help :)
Thank you in advance.
~M
|