ADO connection

Results 1 to 2 of 2

Thread: ADO connection

  1. #1
    Join Date
    Dec 1969

    Default ADO connection

    I am trying an ADO connection with the following code<BR>Dim Conn<BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.Op en("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=C:InetPubwwwroot neempid.mdb ")<BR><BR>the .mdb file is in the folder called "tne " which is in D drive.<BR><BR>I used the Server.Mappath("empid") to get the path C:InetPubwwwroot neempid.mdb<BR><BR>But there is an error which basiclly says file not found ,I am giving the error below<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039 80004005&#039 <BR>[Microsoft][ODBC Microsoft Access 97 Driver] Couldn&#039t find file &#039(unknown)&#039. <BR>/tne/second.asp, line 16 <BR><BR><BR>Please someone help me :-(

  2. #2
    Join Date
    Dec 1969

    Default RE: ADO connection

    The Server.MapPath maps the current virtual directory to a physical directory in your web root. If the .mdb file is in, say, D: ne, which is NOT in your web root, you should not use Server.mapPath. Rather, just explicitly state *where* the .mdb file is in your connection string:<BR><BR>Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=D: neempid.mdb ")<BR><BR>To learn more about Server.MapPath, see:<BR><BR>Using Server.MapPath<BR><BR><BR>Happy Programming!

Posting Permissions

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