dreamweaver| Program | data | database | display
1, open Dreamweaver MX 2004, in the site to create a new asp page (index.asp), select the New project "ASP Javascript." Open the Application panel and select the Database tab in the Applications panel. As soon as we set up the site in front, we chose the document type (that is, the ASP JavaScript we chose) and tested the server (http://localhost/myweb/). Now click on the "+" number and select "Custom connection string".
2, in the bounce out of the "Custom connection string" dialog box,"Connection name" casually write one. The "connection string" should be filled out properly. Driver={microsoft Access Driver (*.mdb)};d Bq=e:\myweb\database\webjxcom.mdb. This is common in hand-written ASP connection database code (related articles see http://www.webjx.com/htmldata/2005-03-24/1111596140.html)
Click on "Test"to show success.
If the connection is unsuccessful, you can open the Dreamweaver help to view the relevant instructions.
3, successfully connected to the database, in the DW is actually automatically generated a connection file. The location in the auto-generated Connections folder, the name you just made in the "Custom connection string" is simply knocking on the named ASP file . You can also notice that the various fields within the MDB file are visible within the DW Database tab.
4, connect the database file is there, but below our specific individual page how and database connection? Select the Bindings tab and add the recordset (query ). Just to see the literal meaning is to come to the SQL query statement.
5, in the pop-up "Recordset" window,"name" casually write a bar, also can not write, the default. But " connection" is going to select the connection object you defined from the Drop-down list, andthe "table" continues to drop the selection (note: This is related to several tables when designing the database).
6, other casual look, in fact, the most important thing is automatically generated SQL statements , click "Advanced ...", you can see the following figure
7, click OK , you will find that the recordset has been bound, all the fields in the database appear.
Notice the Insert button below, and you can select a field, or press the button or drag it to the Index.asp page. The ASP page displays the contents of the database. But only the first row, to show all .... Next
8,"Insert" menu-->> "Application Object"-->> "Dynamic Data"-->> "Dynamic Table". The following figure:
9, pop-up dynamic table to select the set of records that have been set, showing a few records to understand that is the generation of paging program: Data records more, more content, on several pages to display, a few pages. Records are automatically generated by using a table, and then set the properties of the table.
When you click OK , the effect is as follows:
10, then we can press F12 to view the effect, of course, if you are familiar with the HTML code and CSS, then you can format the table to make it look more beautiful! The final effect is as follows:
So far you've learned how to connect the database, how to display the records in the library table. Waiting for you is the following how to insert new records, how to modify records, delete records, and so on. Please continue to follow the following tutorials!