Webucator blogs about online learning and training.

Have you ever wanted to get data from a database to display in your webpage, but were unsure how to do it? Have no fear; your Cheat Sheet is here! The steps below will guide you through the process. These instructions are for a Windows XP Pro OS, a Microsoft Access database 2000-2007, and Dreamweaver CS4.

  1. Create an Access database and save it in the My Documents folder on your desktop
  2. Create a folder on the desktop (name the folder however you want, but with no spaces)
  3. Copy & Paste the new folder into the C:InetPubwwwroot folder. If wwwroot doesn’t exist, you need to set up your web server:
    1. Select Control Panel > Add or Remove Programs > Add or Remove Components
    2. Scroll down to Internet Information Services( IIS) , select it and click Next to install
    3. Follow the instructions until the install is complete, then reboot your computer
  4. Click Start > My Computer > Control Panel > Administration Tools > DataSource ODBC
  5. In the ODBC Data Source Administrator Dialog box click the System DSN tab, and then click Add
  6. In the Create New Data Source Dialog box, scroll down to Microsoft Access Driver(*.mdb or *.accdb), then click Finish
  7. In the ODBC Microsoft Access Setup Dialog box type in any name, then click Select
  8. In the Select Database Dialog box, under Directories, look for the database in the My Documents folder and
  9. Double-click on the database; continually click OK to close all of the screens
  10. Open Dreamweaver CS4
  11. Click on Site > New Site
  12. In the Advanced Tab, select Local Info and type in a site name
  13. In the Local Root Folder area, browse to the desktop folder you created and select it
  14. Select Remote Info on the left side under Categories
  15. In the Access dropdown select Local/Network
  16. In the Remote folder, browse to the Inetpub/wwwroot/[new folder name], then click Select
  17. Select Testing Server on left side under Categories
  18. In the Server Model drop down select ASP VBScript. In the Access drop down, select Local/Network and click OK
  19. Click Done
  20. Go to File > New
  21. Choose ASP VBScript under the Page  Type heading
  22. Give the page a name without spaces
  23. On the menu, click Window > Databases
  24. Click the “+” in the Databases window upper-left corner, and then click Data Source Name (DSN)
  25. Give your Connection a name without spaces
  26. Click the arrow next to Data Source Name
  27. Choose the Data Source Name from the drop down that you created earlier
  28. Click Test and you should receive a message that it was connected properly
  29. Click OK
  30. Go to Window > Bindings on the menu bar
  31. Click the “+”
  32. Choose Recordset Query
  33. Give the Recordset a name
  34. Choose the Connection you just created from the Connection drop down
  35. Choose a Table that you want to view records from
  36. Click OK
  37. Expand the Recordset in the Bindings panel
  38. Drag a field onto the ASP page, in Design view
  39. Save the page
  40. Click on the blue arrow in the Files panel to send ALL of the files to the wwwroot folder
  41. Run the page by select F12 on your keyboard.
  42. You should now see dynamic data in your webpage!

Now you can breath!

You can learn more about working with databases in Dreamweaver in our Database-Driven Websites with Dreamweaver CS4 class.

5 Responses to “Connecting to a Database with Dreamweaver CS4”

  1. Didn’t work – got an error message:

    HTTP 500.100 – Internal Server Error – ASP error
    Internet Information Services


    Technical Information (for support personnel)

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0×80004005)
    [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot open or write to the file ‘(unknown)’. It is already opened exclusively by another user, or you need permission to view and write its data.
    /testing/Test.asp, line 9

    Browser Type:
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; MSDigitalLocker; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; OfficeLiveConnector.1.3; OfficeLivePatch.0.0; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E; .NET CLR 1.1.4322)

  2. Two thiings can cause that error.
    1. If you are in Dreamweaver and you are trying to connect to a database, and the database is open, Dreamweaver won’t connect. Please ensure that the Access database is closed, then try the connectivity again.
    2. Right click on the database on go to Properties. If the checkbox for “Read Only” is cheched, uncheck it and try the connectivity again.

  3. As I website owner I conceive the subject matter here is really good , thankyou for your efforts.

  4. This was helpful…thumbs up.

  5. I defined the testing server. But when I going to BINDINGS, the + mark not active. Below give the tips of create site done and document type done. But testing server not done. I defined testing server just the ways this document explains. But still I can’t create BINDINGS because of testing server. Help me please soon as possible, Because, my final project end day is next Monday… Thanks…


© Webucator, Inc. All rights reserved. | Toll Free: 877-932-8228 | Outside the USA: 315-849-2724 | Fax: 315-849-2723