Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Location
    los angeles
    Posts
    10

    Unanswered: Invalid character on dsn-less connection to Access

    I have set up a connection to a database on a sharepoint that looks exactly like this (I've removed the path for brevity):

    Code:
    <%
    Set connPSC = Server.CreateObject("ADODB.Connection")
    connPSC.Open (Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\\path"))
    %>
    I also created a page that tests this connection (simple query that returns ONE record). When I try to run the test page, I get the following error:

    Code:
    Microsoft VBScript compilation error '800a0408' 
    
    Invalid character 
    
    /isreports/sc/connPSC.inc, line 5 
    
    connPSC.Open (Driver={Microsoft Access Driver (*.mdb)};DBQ=" &_
    ---------------------^
    I actually copied this from one of the hundreds of examples out there for connecting dsn-less to an Access database... I'm not sure why my brackets are being interpreted as invalid. I also tried it without the brackets, but then it expects the close parenthesis right after the string "Microsoft"... any ideas?

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    try this....

    connPSC.Open ("Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\\path"))

    Note the first set of quotes

  3. #3
    Join Date
    Jun 2003
    Location
    USA
    Posts
    1,032
    Here's a good connections resource, and it's advised that you use Jet instead of Microsoft Access for the DSN-less connection to an Access database:

    Able Consulting - ADO Connection String Samples
    http://www.able-consulting.com/ADO_Conn.htm
    J. Paul Schmidt, Freelance Web and Database Developer
    www.Bullschmidt.com
    Access Database Sample, Web Database Sample, ASP Design Tips

Posting Permissions

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