An application must invoke a database driver to establish two-way communications with a database. A web application invokes a driver by using a connection string. A connection string consists of all the information (or parameters) required to establish a connection to a database. In its simplest form, a connection string specifies a driver and a database, as in this example:
Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Inetpub\wwwroot\Scaal\scaalcoffee.mdb
ASP connection strings can contain a Provider parameter specifying an OLE DB provider. If you omit this parameter, by default ASP uses the OLE DB provider for ODBC drivers. In the above example, the OLE DB provider for ODBC drivers would communicate with the ODBC driver, Microsoft Access Driver, which in turn would communicate with the Access database, scaalcoffee.mdb.
The parameters in a connection string may vary depending on the driver. Heres a connection string for a SQL Server database called Cases located on a server named Hoover:
Driver={SQL Server};Server=Hoover;Database=Cases; UID=DanaS;PWD=Queequeg
NOTE |
|
UID stands for user ID; PWD for password. |
Dreamweaver simplifies the process of inserting connection strings into your pages by providing you with a dialog box in which to enter the different connection parameters. For example, heres how the dialog box to define a connection looks when youre developing a JSP application:
After you complete the dialog box and click OK, Dreamweaver inserts the connection string in an include file in your site.