Dreamweaver MX Ultradev Exploration(1)
Author:Eve Cole
Update Time:2009-05-31 21:07:54
Dreamweaver MX Ultradev exploration (1) establishing data sources
In the last lesson, we just briefly introduced the new functions of MX in the backend database. Today we are going to really start to learn its functions. The most important thing about dynamic pages is to combine with the background database and automatically update the Web page. Therefore, our tutorials are inseparable from the database from beginning to end. Without the database, there will be no dynamic pages. So today we mainly talk about how to set up the database connection in MX.
Establishing a connection to the database is a bridge from the Web page to the data. Any form of addition, deletion, modification, and retrieval is based on the connection. You can imagine the importance of the connection. So establishing the right connections is the first part of our learning.
Create a folder where you think it is possible, name it dwmx (of course you have the right not to use this name), and create an Access database in it. It is best to copy the Office Access sample database northwind.mdb into it, because we will They will all use him. Enter MX and set up a site as before in dw or ud. The directory is the directory we just created. The default language is Asp VBScript. Of course, you can also set it in the Files panel on the right.
Create a new file and make settings in the pop-up window (as shown in Figure 1-1). Since MX has added many new back-end development languages, including the latest technology, you can select the page type when creating a new file. If it is a dynamic page, you must also choose an appropriate back-end development language. Of course we choose Dynamic page and Asp VBScript here. I think this is the choice of most friends! Press the Create button.
Figure 1-1
The preparations are all done. Start connecting to the database. Expand the Application panel on the right, select the Databases tab, press the "+" button, and select Data Source Name (DSN) (Figure 1-2)
Figure 1-2
Continue setting in the Data Source Name (DSN) dialog box that pops up. If you have set up a connection in ODBC in the control panel, then you can find the connection you established in the Data Source Name (DSN) drop-down list, enter a name in Connection Name, and press the Test button. If successful, the database will be Connected. But what if we don't set up the connection in ODBC?
1. It's very simple. Click the Define... button to enter the ODBC data source manager. (As shown in Figure 1-3,)
Figure 1-3
2. Select the system DSN label and click the Add button (Figure 1-4)
Figure 1-4
3. Select the data driver we want to use and select it here (as shown in Figure 1-5).
Figure 1-5
4. Click the Finish button and select the path of the database, which should be dwmx/northwind.mdb. Give the data source a name. Just call it "testmx"! (As shown in Figure 1-6).
Figure 1-6
5. Click OK to see our data source "testmx" (Figure 1-7).
Figure 1-7
6. Click the OK button to return to the Data Source Name (DSN) dialog box in MX. Enter the name "northwind" in Connection Name to test, if successful, it's OK.
Now let's look at the Databases tab of the Application panel to see if there is our new data source! (As shown in Figure 1-8)
Figure 1-8
Okay, our bridge has been built, and the next step is to get data from the database through it.
to be continued……