DSNless connections

Results 1 to 3 of 3

Thread: DSNless connections

  1. #1
    Join Date
    Dec 1969

    Default DSNless connections

    Set Connect = Server.CreateObject("ADODB.Connection")<BR>Connect .Open "Classifieds"<BR><BR><BR>How can I convert this to a DSNless connection<BR>

  2. #2
    Mr Swifty Guest

    Default RE: DSNless connections

    By replacing the DSN string by an explicit connection string.<BR><BR>In Access (replace dummies with your own details):<BR>strConn = "DRIVER={Microsoft Access Driver (*.mdb)};" _<BR> & "DBQ=c:somewheredb.mdb;" _<BR> & "FIL=MS Access; Server=servername"<BR><BR>In SQL Server:<BR>strConn = "DRIVER=SQL Server;SERVER=servername;" _<BR> & "UID=userid;PWD=password;DATABASE=databasename"<BR ><BR>Then:<BR><BR>Connect.Open strConn<BR>

  3. #3
    Join Date
    Dec 1969

    Default RE: DSNless connections

    Depends on if you want to use a native OLEDB driver or the OLEDB driver for ODBC. For example, the following code fragment shows how to open an Access 97 database using the native Jet OLEDB provider.<BR><BR>conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:sample.mdb"<BR><BR><BR>For the OLEDB Provider for ODBC the connection string would look something like this:<BR><BR>"Driver={Microsoft Access Driver (*.mdb)};Dbq=d: est.mdb"<BR><BR>The part between the braces {} must be the identical text that shows up in the "Name" column of the "Drivers" tab in the ODBC Administrator applet on your server. Usually the Jet driver is installed with the text shown in the example, but yours may vary.<BR><BR>HTH<BR><BR>Joel<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