Creating a DSN-less Connection to a Datasource.

Please fill out all of the Information and Click on Generate.

Choose your Database Type:
Your Site's IP Address
Database Location (Relative - Non SQL)
SQL Server Name (SQL Only)
Database Name (SQL Only)
User Name
Password

 

Fields

Choose Your Data Type-This field is for selecting the type of database you are connecting to. Selecting the correct type is imperative.

Your Site's IP Address-Enter the Web IP of the customer's site

Database Location (Not Needed if SQL)-This field is for typing the location of the file on your site.
Be sure to type in the full path name, including sub directories, off your root directory.
Example: d:/IP Address/start database location here
If customer's database is in a databases directory and the database is contacts.mdb, you would type in databases/contacts.mdb in the field box.


SQL Server Name (SQL Only)-Enter the IP Address of the SQL server that the customer's database is on.

Database Name (SQL Only)-Enter the Database Name of the Customer's SQL database that you want to connect to

User Name-Enter the user name for the database that you are connecting to (Not needed if database is not password protected)

Password-Enter the password for the database that you are connecting to (Not needed if database is not password protected)

ODBC Connection String Examples

The following examples provide methods to connect to Microsoft Access, Excel, or to Microsoft SQL databases using ODBC connection strings. These examples will need to be configured to your particular directory path and database name.

ODBC DSN-LESS Connection strings for Microsoft Access
For Standard Security:
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & "Dbq=D:\yourdirectorypath\MyDatabase.mdb;" & "Uid=admin;" & "Pwd="

If you are using a Workgroup (system database):
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & "Dbq=D:\yourdirectorypath\MyDatabase.mdb;" & "SystemDB=D:\yourdirectorypath\MyDatabase.mdw;", "myUsername", "myPassword"

If want to open up the MDB exclusively:
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & "Dbq=D:\yourdirectorypath\MyDatabase.mdb;" & "Exclusive=1;" & "Uid=admin;" & "Pwd="

ODBC DSN-LESS Connection strings for Microsoft Excel:
oConn.Open "Driver={Microsoft Excel Driver (*.xls)};" & "DriverId=790;" & "Dbq=D:\yourdirectorypath\mySpreadsheet.xls;" & "DefaultDir=D:\yourdirectorypath"

ODBC DSN-LESS Connection strings for Microsoft SQL:
For Standard Security:
oConn.Open "Driver={SQL Server};" & "Server=MyServerName;" & "Database=myDatabaseName;" & "Uid=myUsername;" & "Pwd=myPassword"

For Trusted Connection security:
oConn.Open "Driver={SQL Server};" & "Server=MyServerName;" & "Database=myDatabaseName;" & "Uid=;" & "Pwd="
Or
oConn.Open "Driver={SQL Server};" & "Server=MyServerName;" & "Database=myDatabaseName;" & "Trusted_Connection=yes"

To Prompt user for username and password:
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Driver={SQL Server};" & "Server=MyServerName;" & "DataBase=myDatabaseName"