A connection string combines all the information your web application needs to connect to a database. Dreamweaver inserts this string in your pages server-side scripts for later processing by your application server.
A connection string for Microsoft Access and SQL Server databases consists of a combination of the following parameters separated by semicolons:
Provider specifies the OLE DB provider for your database. For example, here are parameters for common OLE DB providers for Access, SQL Server, and Oracle databases, respectively:
Provider=Microsoft.Jet.OLEDB.4.0;... Provider=SQLOLEDB;... Provider=OraOLEDB;...
For the parameter value of your OLE DB provider, see your provider vendors documentation, or consult your system administrator.
If you dont include a Provider parameter, then the default OLE DB provider for ODBC is used and you must specify an appropriate ODBC driver for your database.
Driver specifies the ODBC driver to use if you dont specify an OLE DB provider for your database.
Server specifies the server hosting the SQL Server database if your web application runs on a different server.
Database is the name of a SQL Server database.
DBQ is the path to a file-based database such as one created in Microsoft Access. The path is the one on the server hosting the database file.
UID specifies the user name.
PWD specifies the user password.
DSN is the data source name, if you use one. Depending on how you define the DSN on your server, you can omit the connection strings other parameters. For example, DSN=Results
can be a valid connection string if you define the other parameters when you create the DSN (see Using a DSN).
Connection strings for other kinds of databases may not use the parameters listed above, or will have different names or uses for the parameters. For more information, see your database vendors documentation, or consult your system administrator.
Heres an example of a connection string that will create an ODBC connection to an Access database called trees.mdb:
Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Inetpub\wwwroot\Research\trees.mdb
Heres an example of a connection string that will create an OLE DB connection to a SQL Server database called Mothra located on a server called Gojira:
Provider=SQLOLEDB;Server=Gojira;Database=Mothra;UID=jsmith; PWD=orlando8