Unable to locate file

Results 1 to 2 of 2

Thread: Unable to locate file

  1. #1
    Join Date
    Dec 1969

    Default Unable to locate file

    Not sure why I keep getting this error. By default, it&#039s looking for my file in C:WINNTsystem32 so that&#039s where I put my file. Also below is my code. Any ideas?<BR><BR>(error msg):<BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR>[Microsoft][ODBC Microsoft Access Driver] Could not find file &#039(unknown)&#039. <BR>/strategic_ops/operationsmgmt/Pete_Test/DatabaseConnect.asp, line 21 <BR><BR>(my code):<BR>Dim objConn<BR> Set objConn = Server.CreateObject("ADODB.Connection")<BR> objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("WidgetWorld.mdb") & ";"<BR> objConn.Open<BR><BR>Thanks

  2. #2
    Join Date
    Dec 1969

    Default RE: Unable to locate file

    *IF* you did *not* have the Server.MapPath in there, then indeed it would look for the file in some system directory.<BR><BR>But since you now have code Server.MapPath (correctly, incidentally), the .mdb file must be in the *same directory* as the .asp file that is trying to access it.<BR><BR>To understand this for yourself, try doing<BR><BR>&#060;%<BR>Response.Write Server.MapPath("WidgetWorld.mdb") & "&#060;P&#062;"<BR>%&#062;<BR><BR><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