Thomas Wallace: Lectures and Resources - A collection of website design lectures and resources

Connecting to Your Database with a Custom Connection String

Setting up the Site

  1. Open Dreamweaver and under the Site menu select Manage Sites.
  2. Select New to create a new site.
  3. Select the Advanced Tab and make sure you have Local Info selected from the Category menu.
  4. Name the site and set the default file and images directories.
  5. Select Remote Info from the Category menu and set Access to FTP
    • FTP Host: www.ualr.edu
    • Host Directory: dbexample
    • Login: username
    • Password: password
  6. Select Testing Server from the Category menu and set Server Model to ASP VBScript and Access to FTP
  7. The remainder of the settings should be filled in but you will need to change the URL prefix to: http://www.ualr.edu/
    You should also set the URL prefix to the same thing in the local info category
  8. Select Test to make sure that everything is connecting properly. Once you receive the message that Dreamweaver has successfully connected to your web server click ok and then Done at the bottom of the Manage Sites dialogue box.

Connecting to the Database

  1. In Dreamweaver, go to File > New and select Dynamic Page as the Category and ASP VBScript as the Page Type

Site Definition

  1. Once the page has loaded save it as email.asp in the dbexample folder.
  2. Open the Application tool palette and select the database tab. You will see that there are four steps listed on this panel and we have completed three of these. We now need to complete the final step which will connect us to our database.

Applications Pallette

  1. Click the + in the database tab and select Custom Connection String

Connection String

  1. Name the Connection ITMocha_Email
  2. In the Connection String Text Box enter:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &Server.Mappath
("\username\dbexample\data\itmocha.mdb")
& ";User Id=;Password=;"

or you can copy it from this file.
Note: The Ampersand (&) is the only character in the string that is surrounded by spaces.

  1. Make sure Use driver on testing server is checked.
  2. Press Ok
  3. Upload All files to the web server. Notice that there is a new folder name Connections. This folder contains all of the necessary files to connect the web page to the database. In order for this to work, the Connections folder must reside on the server. Highlight the Connections folder in the local view and press the blue upload arrow. Your screen should look something like this.

Screen Capture

  1. Once you have uploaded all of your files right click on the database name in the application panel and select test to make sure that you have a good connection. If your connection was successful press the + next to the connection name.

Your screen should now look like this:
DB Tables

  1. Open the File Browser so that you can see both local and remote files. You will notice that Dreamweaver has created a folder called Connections. This folder contains all of the necessary files to connect the web page to the database. In order for this to work, the Connections folder must reside on the server. Highlight the Connections folder in the local view and press the blue upload arrow. Your screen should look something like this.

That’s all folks!


What I'm Reading

RSS Feed IconView More

Announcements

  • 1.24.2012
    Structure, Content, Design, Behavior
My Calendar