Creating a database connection

Creating a database connection

The final step of the setup process is to create a connection to the database.

To create a database connection in Dreamweaver:

  1. Open any ASP.NET page in Dreamweaver, and then open the Databases panel (Window > Databases).
  2. Click the Plus (+) button in the Databases panel and select OLE DB Connection from the pop-up menu.

    The OLE DB Connection dialog box appears.

  3. Enter connTownsend as the connection name.
  4. Click the Templates button.

    The Connection String Template dialog box appears.

  5. From the list of templates, select Microsoft Access 2000 (Microsoft Jet 4.0 Provider) and click OK.

    Dreamweaver adds a connection string template in the OLE DB Connection dialog box. The template contains placeholders for missing information in the connection string.

  6. In the Data Source text box, enter the full path to the sample database file on your hard disk or the remote computer’s hard disk. If ASP.NET is running on your local computer and you installed Dreamweaver to its default location, use the following path:

    C:\Program Files\Macromedia\Dreamweaver 8\Tutorial_assets\data\tutorial.mdb

    For example, you might enter this path as the value of Data Source for a database on your local hard disk:

    Data Source=C:\Program Files\Macromedia\Dreamweaver 8\Tutorial_assets\data\tutorial.mdb;

    Or you might enter this path for a database on a remote server:

    Data Source=C:\users\Denman\Sites\data\tutorial.mdb;

  7. Delete the User ID and the Password lines.

    The Access database does not require a user ID or password.

  8. Click Test.

    Dreamweaver attempts to connect to the database. If the connection fails, do the following:

    • Double-check the path to the database.
    • Check the settings for the folder Dreamweaver uses to process dynamic pages (see Specifying where dynamic pages can be processed).
    • Deploy the supporting files by selecting Site > Advanced > Deploy Supporting Files.
    • Consult Troubleshooting Database Connections in Using Dreamweaver (Help > Using Dreamweaver).
  9. Click OK.

    The new connection appears in the Databases panel.

The sample ASP.NET application is now set up for the Getting Started with Dreamweaver tutorials. For more information, see Tutorial: Developing a Web Application.



Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly