Problems Connecting to Access Database

Results 1 to 2 of 2

Thread: Problems Connecting to Access Database

  1. #1
    Join Date
    Dec 1969

    Default Problems Connecting to Access Database

    I have upload an Access2000 Database onto a webserver which is hosted by a company. My intention is to use the database to verify whether a particular user is allowed to login to a section for registered users only by calling an asp page to do so.<BR><BR>I try to connect to my Access database using the codes below:<BR> <BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.ConnectionString="DRIVER={Microsoft Acess Driver (*.mdb)};" & "DBQ=d:abcUpdate5.mdb"<BR> <BR> <BR> Dim objRS<BR> Set objRS = Server.CreateObject("ADODB.Recordset")<BR> objRS.Open "UpgradePack", objConn, , , adCmdTable<BR> <BR>However, I am unable to connect to the database. I have the following errors:<BR><BR>ADODB.Recordset error &#039 800a0e7d&#039 <BR><BR>Operation is not allowed on an object referencing a closed or invalid connection. <BR><BR>/result.asp, line 20 <BR><BR>Can anyone tell me what has gone wrong with my coding?<BR><BR>Thanks in advance!<BR>Regards <BR>Jen<BR>

  2. #2
    Harald Guest

    Default RE: Problems Connecting to Access Database

    Hi..There might be a problem with the database. Many companies hosting webservers for ASP-pages doesn&#039t support Access 2000 (like eWebcity). Try to convert it to version 9795.<BR><BR>If that didnt&#039 work out, here is some code that works fine.. I&#039m using SQL query to pull data from a table..The line Server.MapPath finds the virtual path to the database..<BR><BR>dim conn <BR>dim strSQL <BR>dim rs<BR><BR>Set conn = Server.CreateObject("ADODB.Connection")<BR>Set rs = Server.CreateObject("ADODB.Recordset")<BR><BR>conn .Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("
    ame.mdb"))<BR><BR>strSQL = "SELECT rows FROM table "<BR><BR>rs.Open strSQL, conn , 2, 3<BR><BR><BR>At the bottom of the page, remember to clean up the mess:<BR>&#060;% rs.Close<BR>conn.Close<BR>%&#062;<BR><BR>This should work out fine. If it doesn&#039t you could email me at: and I&#039ll see what I can do..<BR><BR>Regards<BR>Harald<BR><BR>

Posting Permissions

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