Implementation of ASP dynamic website construction with Dreamweaver

Source: Internet
Author: User
Tags define definition connect odbc odbc connection split table name dreamweaver
Dreamweaver| News | website construction

Macromedia Dreamweaver MX is a professional HTML editor for designing, coding, and developing Web sites, Web pages, and Web applications. Whether you are willing to enjoy the mastery of hand-written HTML code or a preference for working in a visual editing environment, Dreamweaver will provide you with a useful tool to make your WEB authoring experience more perfect. Dreamweaver enables you to generate WEB applications supported by dynamic databases by using server technologies such as CFML, ASP.net, ASP, JSP, and PHP.

The content of this chapter is mainly from setting up ASP running environment (installing, configuring IIS), setting up a site, establishing database, Dreamweaver connecting with database (using DSN connection database), displaying database records, inserting database records, modifying database records and deleting database records, etc. To achieve the full implementation of the ASP dynamic website design process, I hope to give you the establishment of an ASP dynamic website Help.

  System Software Requirements

This tutorial will run on the Windows XP operating system, creating Web sites with IIS Web servers and Access 2003 databases, and developing dynamic page technology through Dreamweaver MX 2004+asp technology.

table Software Environment List

Software Application
Windows XP Operating system
IIS 5.0 Web server
Access 2003 Database
Dreamweaver MX 2004 Dynamic page Design

Windows XP's Internet Information Service (IIS) provides Windows with powerful Web computing capabilities. IIS is a secure platform for creating and developing dynamic Web site solutions.

  First, the establishment of ASP operating environment (install, configure IIS)

(i) Installation of IIS

In Windows XP (Professional Edition), put the Windows XP installation CD into the CD drive, click Start-> settings-> control surface-> Add or Remove Programs-> Add or remove Windows Components-> in Internet Information Services (IIS) Items, click Next to install until you complete the installation of Internet Information Services (IIS). As shown in the figure:

  

(ii) configuration of IIS

Click Start-> set-> control surface version-> management tool->internet Information Service (IIS), click the local computer, Web site in the pop-up window, right-click the default Web site,

Select the home directory in the pop-up window, select the Browse button on this ground path, select the Site directory you created (such as: E:\ My Site), select the document item, press Add button, add the index.asp document to complete the configuration of IIS.

  

  Second, the establishment of the site

Macromedia Dreamweaver MX is a site creation and management tool that allows you to create a separate document and create a complete Web site.

Definition of site

The first thing to start using the Dreamweaver MX 2004来 to create a database site is to define the Web site, and you must tell the Dreamweaver MX 2004 site root directory, as well as the server location, type, and other related information.

After starting Dreamweaver MX 2004, select site/admin site/New from main menu ... Define a new site.

In the local InfoBar in the pop-up menu--Enter My site in the site name, select "E:\ My Site" in the local root folder, and fill in the HTTP address entry: "Http:\\127.0.0.1\" the remaining items remain unchanged. Select test server at the classification, select ASP VBScript at the server model, access to local/network, and click OK to finalize the definition of the site.

In the Web Site Administration window you can see the files in the root directory of the Web site.

  

  How to establish an Access database

This system uses Access 2003 to create a database named Db1.mdb. The data is read by the system, and the storage is the operation of the database.

In an Access 2003 database, all data stores are centered around the table, and the data is not stored elsewhere in the database. Although there are many ways to access data, they all come from tables. Can be said to represent the soul of a database.

Perform the start-> program->mccrosoft Office-> mccrosoft Office Access 2003 (when you install Mccrosoft Office 2003, you also hook up Office Access 2003) , execute file-> new, select Empty database on the right side of pop-up window, filename keep default, click button, select "CREATE table using designer" from pop-up window, fill in the corresponding field, as shown in the following table:

Field name Data type Field size
Id Automatic numbering
Name Text 20
Gender Text 30
Age Digital 10
Input time Date/Time
Address Text 50

After the completion of the field name input, select ID as the primary key, the data table name retains the default "Table 1", save it in the "E:\ My Site" directory to complete the establishment of the database. As shown in the figure:

  

  Iv. Dreamweaver connection to the database (using DSN to connect to the database)

If you plan to use a database in a network application, you need to create at least one database connection. Without a database connection, the application will not know where to find the database or how to connect to the database. When you create a database connection in Dreamweaver MX 2004, you provide the application with information or parameters to establish a connection to the database.

1 DSN definition

(1) In Control Panel, double-click the Admin tool, double-click the ODBC Database source icon, the ODBC Data Source Manager window appears, and select the System DSN tag.

(2) Click "Add", and then select the database driver, the system uses an Access database, so Microsoft Access Driver (*.mdb), click the Finish button.

(3) An ODBC Microsoft Access installation window appears with a name conn the connection in the data source name, stating that a column is not required.

(4) Click the "Select" button in the window to locate the location of the database ("E:\ My Site") and select the appropriate database file, select Db1.mdb, the database file that you just selected appears in the DB column of the ODBC Access installation window, as shown in the figure.

  

2 DSN Connection

After the database name (DSN) is established, you can create an ODBC connection between the network application and the database, and DSN is defined to use it to invoke various parameters.

(1) Start Dreamweaver MX 2004, open the already defined site "My Site", in the site-My Site window click the right mouse button, click the new file, file name changed to index.asp, double-click the file index.asp make it in edit state.

(2) Click Database In window, from the Database menu. Click "+" in the window, select the data source name, type the name of the connection from the "Connection name" column of the pop-up window conn; Select the database source name from the Drop-down menu in the data source name (DSN) conn;dreamweaver the connection column choose to use a local DSN. The following figure:

  

  V. Production of display database records page

(1), double-click the index.asp file so that it is in edit state, select the application's "Bindings", click "+", à Recordset (query), and in the pop-up recordset window "name" Fill in RS, connect select conn, table select "Table 1", "column" Select all, click OK to finalize the binding of the recordset. The following figure;

  

(2), in the Index.asp edit state, insert 2 rows of seven columns of the table, and center it, add the content label from the datasheet to the seven spaces on the previous line, and then drag the recordset's fields into the corresponding space in the next line, and then enter the total number of database records x in the top of the table, and the current article X, And then drag the total number of records in the Recordset, the first record into the corresponding word, and center it. As shown in the following illustration:

  

(3), select the second line of all the table, click on the server behavior, click "+" Select repeat region, keep the default state, click to determine the completion of the design of the repeat display area.

(4), click on the menu "Insert", select "Application Object"-> Recordset paging-> recordset navigation bar, in the pop-up window (keep the default value) Click OK. As shown in the figure:

  

  Vi. making Add data record page

Create a new page, named Add.asp, and put it in edit state, click on the menu "Insert", select "Application Object"-> Insert record-> Insert Record Form Wizard, in pop-up window "Connection" SELECT Conn, "Insert to Table" Select "Table 1", "Insert go to" Fill in the a.asp (submit the successful display of the page, will be established in the next step), delete the unwanted fields (ID), and then click the OK button to complete the production of the page.

  

  

Create a new page, save as a.asp, and fill in the page with "Add Data success!" Complete the page design.

  Vii. make the Modification data record page

Open the index.asp file, make it editable, position the mouse on the first line, and click the Split cell icon, as shown below:

  

  

Splits the column into 2 columns. The second line is split into two columns in the same way, in the last column fill in the "Modify" character, select "Modify", make it selected, choose the server behavior-> "+", go to the detailed page, from the pop-up menu, detailed page fill edit.asp, other remain unchanged to complete the page setup.

  

To create a edit.asp new page, bind it to a recordset named RS (filter Item selection ID, other default value) in the same way as above. Click "Insert" on the menu, select the Application object-> update record-> update Record Form Wizard, select Conn in the popup connection item, "To Update table" select "Table 1", "Select Record is" to select RS, unique key column select ID, "Update go to" Fill in the index.asp (modify the Display page, will be established in the next step), delete the unwanted field (ID), and then click the OK button to finish making the page (the rest is the default value). As shown in the following illustration:

  

  

  Eight, the production deletes the data record page

Create a "delete" connection on the index.asp using the method you've learned above. The new page is named Delete.asp, opens it, creates a seven-row two-column table, fills the field name on the table on the left, and then binds a recordset to the page and drags its fields to the corresponding right table. Create a form and drag the table above into the form, and create a delete OK button for the form, as shown in the following illustration:

  

Click on the server Behavior-> Recordsets page-> to move specific records, press the OK button (keep the default). Click on the server behavior-> Delete the record, in the pop-up menu to fill in the relevant content. As shown in the figure:

  

A relatively complete ASP Dynamic Web site is finally completed. According to the guidance of this tutorial, the reader can realize the asp+access dynamic website.



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.