Database Connection

Results 1 to 2 of 2

Thread: Database Connection

  1. #1
    Join Date
    Dec 1969

    Default Database Connection

    I need help with a database connection. I am receiving this error.<BR><BR>Microsoft VBScript compilation error &#039;800a03f2&#039; <BR><BR>Expected identifier <BR><BR>/pool/, line 4 <BR><BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ= Server.MapPath("./data/List.mdb");"<BR>------------------------------------------------------------------------------^<BR>The arrow is pointing to the / before data

  2. #2
    Join Date
    Dec 1969

    Default Quote inside quotes...

    You have a string and you put a " mark inside the string. What actually happens is that VBS *stops* the string at the first matching " mark and *then* tries to make sense of what is left.<BR><BR>SO it does:<BR><BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ= Server.MapPath("<BR><BR>and says...looks like a good string to me. But then it has no idea what to do with <BR><BR>./data/List.mdb<BR><BR>or any of the stuff that follows it.<BR><BR>What you missed, badly, is that Server.MapPath is a VBScript function. You tried to make it part of the connection string, but ODBC would never understand what it meant.<BR><BR>Try this:<BR><BR>strConnect = "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("./data/List.mdb") & ";"<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