CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • Microsoft Access Database Engine (0x80004005) Could not find file

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    44
  • Date Created
    Tuesday, November 16, 2010
  • Last Updated
    Wednesday, November 17, 2010
  • This Article Has been Viewed
    2655 times
  • Short Desc
    When working with Database's with your project, you need to make sure that the connection string does indeed lead to the directory that the database is in, if not, you will get this error.
  • Details
    When creating your connection string, make sure that the database does infact exist in the location where you have create the string for.
    If the database is located in a different folder (or) is named differently that what you have supplied in the connection string, you will get this error:

     
    Microsoft Access Database Engine (0x80004005)
    Could not find file 'G:\InetPub\wwwroot\Foldername\pagin.accdb'.
    /paging.asp, line 5
  • Recreate Issue
    To recreate this issue,

    <%
    Set objConn = CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:\InetPub\wwwroot\folderlocation\pagin.accdb;Persist Security Info=False;"
    objConn.Open
    %>


    The database name in this case if missing the g to make it paging.accdb
  • Resolve Issue
    To correct this issue.

    Using the following string for your Access Database

    Using the 2000-2003 Access Database

    <%
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _
    Server.MapPath ("paging.mdb") & ";"
    objConn.Open
    %>

    (or)Direct path to the database
    <%
    set objConn=Server.CreateObject("ADODB.Connection")
    objConn.Provider="Microsoft.Jet.OLEDB.4.0 "
    objConn.Open "G:\InetPub\wwwroot\folderlocation\paging.mdb"
    %>


    If you are using the new ACCDB database by Microsoft 2007 and above, then you can use the following

    <%
    Set objConn = CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & _
    Server.MapPath ("paging.accdb") & ";"
    objConn.Open
    %>

    (or) Using a direct path to your database.
    <%
    Set objConn = CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=G:\InetPub\wwwroot\folderlocation\paging.accdb;Persist Security Info=False;"
    objConn.Open
    %>


    Making sure that you have spelled the name of the database correctly, as you can see in the Recreate Example above.