Access Connection Error

Results 1 to 3 of 3

Thread: Access Connection Error

  1. #1
    Join Date
    Dec 1969

    Default Access Connection Error

    I am getting the following error when trying to connect to an Access dB<BR><BR>The Path parameter for the MapPath method must be a virtual path. A physical path was used. <BR><BR>below is the code I am using ...<BR><BR>thanks in advance<BR><BR>Dim objConn<BR>Dim strConnect<BR>Dim objRst<BR>Dim strSQL<BR><BR>strSQL="SELECT CarOwners.* FROM CarOwners; "<BR><BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("c:dbasesCardB.mdb"))<BR>objConn.Op en<BR><BR>&#039;Create RecordSet object<BR>Set objRst = Server.CreateObject("ADODB.Recordset")<BR>objRst.O pen strSQL,objConn<BR>%&#062;<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Access Connection Error

    When using the Server.MapPath() function, you need to use relative path names.<BR><BR>Change the following line:<BR><BR>objConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("c:dbasesCardB.mdb"))<BR><BR>to ...<BR><BR>objConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("CardB.mdb"))

  3. #3
    Join Date
    Dec 1969

    Default Ehh...That probably won't work.

    More likely you need to do this.<BR><BR>objConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=c:dbasesCardB.mdb")

Posting Permissions

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