Reflection on exercise of Dreamweaver CS3
Step2: Create a new site with the name"project" using Site>New Site. Then, save it in C:\inepub\wwwroot\project\..... At the same time, choose to use a server technology.
Step3: Create the database file in Access. Open microsoft access and click at Black Database. Then, save the file in C:/inepub/wwwroot/data in the form of "MS Access 2002-2003 with.mdb file extension.(data.mdb) After saving the flie, you can edit the file as you need and save it again when you finish your editing.(For the message file, choose Memo as its data type which can hold characters more than Text.)
Step4: Setup the connection. Open an ASP page in Dreamweaver and then open the Databases panel (Window>Databases). Click the Plus(+) button on the penal, select Custom Connection String from the menu. Then enter a name and a connection string. ["Driver={Microsoft Access Driver (*.mdb)};DBQ="& Server.MapPath("/maklumat/db1.mdb")] complete the options, and click the OK.( you can select"Using Driver on Testing Server" to test your database file.
Step5: Setup the Contact Form. Create a New Page throught :File>New>Blank Page>ASP VBScript>Create. Using a combination of Labels and Text Boxes and a Text Area layout the Form you like.(you also need to change the name of the Text Field in the properties.) Then, save it as contact.asp. Make sure the file is saved in C:inepub\wwwroot\project\
Step6: Writing a data into a database using the Insert Record. Activate Server Behaviors tab. Click the Plus(+) button on the penal, selest Insert Record. Select the connection that you had created before in the dialog box displayed. Save your file using File>Save.
Step7: Reading /Viewing a data from a database using the RecordSet. Create a new ASP VBScript file, save the file as view.asp in the same location with contact.asp file. Then create the layout using a table.(Insert>table) Active Server Behavors tab and click the Plus(+) button on the penal, select RecordSet and the connection you had created before. Next, activate Bindings tab, click the Plus(+) button on the penal, select RecordSet(Query). Now, you can see the existing Recordset1 and click at Plus(+) sign you can see all the fields in the database. Drag, surname into cells in column 2 in the table that you created in view.asp. ....Save your file after you finish it.(File>save).
Step8: Execute the file. Open back your contact.asp file and bouble click Insert Record behaviorin Server Behavior window and add view.asp in after inserting go to : section. Click OK. Then, save your contact.asp file. Click at Preview in Browser icon. Type any data and click Submit button to test....

没有评论:
发表评论