
Of course, this important step establishes a connection between Dreamweaver and the files on your computer. Aside from that however, it also allows you to tell Dreamweaver what server-side technology you plan to use for the defined site. This process is important because Dreamweaver must configure its interface according to the server-side technology you pick. The second step to working with dynamic data is to establish a connection between Dreamweaver and your data source. Numerous methods for connecting your web applications to your data sources (in Dreamweaver) exist, including the following: DSN Connection (supports Access, MSDE, and MySQL via ASP) DSN Connection via RDS (specifically for ColdFusion) Custom Connection String/DSN-less Connection OLE DB Connection (specifically for ASP.NET but can be used by other server models such as ASP) MySQL Connection (specifically for PHP) As you can see, numerous methods exist for connecting your web applications to your data sources. The server-side technology you plan on implementing in conjunction with the data source you plan to employ will guide the method you'll use to connect with. In general, there's no preferred method. The method that works best for you is the route you should ultimately take. To help you make the decision, I've outlined each connection method in the next few sections. Connecting to a Data Source Using a DSN As mentioned in Chapter 21, "Introduction to Web Applications," to communicate with database data, a bridge of communication must be established between the web application in Dreamweaver and the actual data source itself. This bridge of communication is handled through a Data Source Name (DSN). To understand the concept of DSN is to understand how applications connect to database data using the web server's operating system. As you learned in Chapter 21, at this foundation level is Open DataBase Connectivity (ODBC), a standard database access method developed by the SQL Access group in 1992. The goal of ODBC is to make it possible to access any data from any application, regardless of which database management system is handling the data. ODBC manages this by inserting a middle layer, called a database driver, between an application and the database. This layer translates the application's data queries into commands that the database understands. For this to work, both the application and the database must be ODBC-compliant, that is, the application must be capable of issuing ODBC commands and the database must be capable of responding to them. DSNs provide connectivity to a database through the ODBC driver. The DSN contains a database name, directory, database driver, UserID, password, and other information. After you create a DSN for a particular database, you can use the DSN in an application to call information from the database. NOTE For the most part, ODBC drivers that connect web applications to Access and MSDE/SQL Server come pre-installed with the operating system, so there's nothing to download. However, if you plan on using MySQL, you'll need to download the latest ODBC 3.51 driver. The driver, titled Connector/ODBC 3.51, can be found along with the other MySQL downloads at http://dev.mysql.com/downloads/index.html. A negative to using DSNs is that they're generally less efficient than other standards when connecting to data sources. However, they are probably more than adequate for low-to-moderate production servers. If you're developing a more robust application, you may want to consider some of the other methods discussed later in this chapter. If you plan to develop a web application with ASP.NET or