dsn-less connection

Results 1 to 2 of 2

Thread: dsn-less connection

  1. #1
    Join Date
    Dec 1969

    Default dsn-less connection

    i am trying to set up a dsn less connection but it&#039s not working. i still get the " database is unknown" error. here are the few things i&#039ve tried. does anybody know any other way to do this or how i can fix my code? thanks:<BR><BR>Set Conn = Server.CreateObject("ADODB.Connection") <BR>ConnectionString = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:mydatabaseinfoform.mdb" <BR>Conn.Open ConnectionString <BR><BR>and <BR><BR>Dim Conn, dbPath <BR>dbPath = "C:yourdatabaseDirdatamdb.mdb" <BR>Set Conn = Server.CreateObject("ADODB.Connection") <BR>Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & dbPath <BR><BR>i dont&#039 think that one works because i need MDAC 2.1 or something? i dunno i&#039m not quite understanding what this second one is all about. i got it from a suggestion that someone gave me in this forum....<BR><BR><BR>

  2. #2
    peterjl@austec.net.au Guest

    Default RE: dsn-less connection

    I think I see the problem with your first eaxample, you need to put braces around the driver spec:<BR><BR>ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=C:mydatabaseinfoform.mdb;" <BR><BR>And you should also terminate each part of your connection string with a ";". You have not done tis on your last clause, ie the dbq=...

Posting Permissions

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