1. Create a database in SQL Server 2000
?? 1. Create a database in SQL Server 2000
?? (1) Open the Enterprise Manager of SQL Server 2000, right-click on the database option, and click New Database.
??(2) Set the database name to sjk in the new database properties.
??2. Create a user in SQL Server 2000
??(1) Open the Enterprise Manager of SQL Server 2000 and open the security folder.
??(2) Right-click on the login option to open the new login property, set the user name to zl, select SQL Server authentication for authentication, then enter the password, and set the user default database to sjk in the default settings below (first step into the newly created database).
??(3) Select the "Server Role" tab and select the required server roles. You can select all for convenience.
??(4) Select the "Server Access" tab and select the database that the user can access. Just click the box in front of the database you want to access, and the system will put a check in the box. Then select the permissions that the user has when accessing the database in the database role below. It is recommended to select all permissions.
2. Connection between database and ODBC
Connection steps:
(1) Open "ODBC" in the "Control Panel" and select the "System DNS" panel.
??(2) Click the Add button, select "SQL Server" and click "Finish".
??(3) Configure the DNS name and server. The name and description can be defined by yourself (preferably not with numbers). The server name must be the server name of SQL Server2000 in the computer where the data is located (usually the name of the computer), and then Click OK.
??(4) Select "SQL Server authentication using user input login ID and password", and enter the user name and password established in SQL Server in the first step in the "User Name" and "Password" text boxes. Click OK until the test data interface appears.
??(5) Click "Test Data Source" to display the test interface, click "OK".
3. Connect Dreamweaver to SQL Server through ODBC
?? 1. Create a site named syf
?? Creation steps:
(1) Open the site panel in Dreamweaver MX and click Edit Site.
??(2) Click "NEW" to create a new site.
??(3) Select the "Local Information" option and set the name of the site and the file storage path.
??(4) Select the "Test Service" option to set the path to interpret ASP (consistent with the path set in PWS or IIS).
??(5) Click OK to complete the creation work.
??2. Connection between ODBC and Dreamweaver
??Connection steps:
??(1) Select the "Database" option in the "application" panel in Dreamweaver, and click the "+" sign above, and select the second option in the drop-down menu Item(DNS).
??(2) Set the name of the database in Dreamweaver. "Connection name" is used to set the name used to represent the connection in Dreamweaver. As long as the name does not contain numbers. "Data source name" selects the name when the database and ODBC are established in the second step. The user name and password are the user names and passwords established in SQL Server, and then click "OK".
??So far we have connected the database to Dreamweaver. The following uses an example of displaying student information on a web page to illustrate how to apply it.
4. Create a web page
?? 1. Create a new asp web page in Dreamweave, and create a table with 2 rows and 4 columns in the web page. The first line is the header, and enter "Name", "Gender", "Age", and "Location" respectively. ".
??2. Introduce the tables in the database into Dreamweaver.
??Select the bindings tab in the application panel of Dreamweaver (or press F10), click the "+" sign, and select the first "recordset (Query)" option. After selecting, click OK.
??3. If the settings are correct, the corresponding interface will appear.
??4. Click the "+" in front of the record set, and each field of the table in the database you selected will be displayed.
??5. Use the mouse to drag each field of the table in the database that appeared in the previous step into the corresponding second row in the table, that is, drag the "Name" field into the "Name" header.
??Now the data in the database has been introduced into the web page, but now only one record in the table is displayed. If you want to display multiple records, you can first select the second row of the table, and then click the server behaviors option in the application panel card, click "+", select the "repeat region" option, and set all displayed records or the number of records displayed on one page as needed.
??We can see that in the "repeat region" option, the insertion, deletion and update of records can be easily completed. We will not describe them one by one here. Interested readers can delve further.