Access Database Connection problems

Results 1 to 2 of 2

Thread: Access Database Connection problems

  1. #1
    Join Date
    Dec 1969

    Default Access Database Connection problems

    Anyone hazard a guess why my Access database sitting on an IIS 4 Server should perform aok over a period of time and then fall over for no apparent reason. Any work arounds or is it better to go for an SQL Server solution? I note some comments on this site about connection problems and wondering if this problem is universal? Using the classic getrows into an array solution so only opening the database up and sucking the records out before closing . . .<BR><BR>Code:<BR>&#039 --------------------------------<BR>&#039 create connection strings to database<BR>Set objConn = Server.CreateObject ("ADODB.Connection")<BR>objConn.ConnectionString=" DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:&#060;path of database and database name here&#062;;DefaultDir=d:&#060;directory where database resides&#062;;DriverId=25;FIL=MS Access;MaxBufferSize=512;PageTimeout=20;UID=&#060; username&#062;;PWD=&#060;password&#062;"<BR>objCon n.Open<BR><BR>&#039 open recordset . . .<BR>Set objRS = Server.CreateObject("ADODB.Recordset")<BR>strSQL = "SELECT * FROM &#060;tablename&#062; ORDER BY Date_Entered ASC"<BR>objRS.Open strSQL, objConn, adOpenForwardOnly, adLockReadOnly<BR>&#039 ------------------------------------------------------

  2. #2 Guest

    Default Make sure to dispose of objects?

    Since you have not shown anything after the recordset open, I wonder if you are properly closing off your connection. It should be done as soon as you have retreived you data, like this:<BR><BR>&#060;%<BR>objRS.Close<BR>Set objRS = Nothing<BR>objConn.Close<BR>Set objConn = Nothing<BR>%&#062; <BR><BR>If you do not do this, the memory, which is allocated for the objects, will not be released and eventually all memory will be allocated and the server will crash.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts