You can use Dreamweaver to create ASP command objects that insert, update, or delete records in a database. A command object is a server object that performs some operation on a database. You supply the command object with the SQL statement that performs the operation on the database. For more information, see ASP command objects.
You can also supply the object with a stored procedure that performs the operation. For more information, see Running a stored procedure (ASP).
The Command dialog box appears.
Dreamweaver starts the SQL statement for you based on the type of operation you select. For example, if you select Insert, the dialog looks as follows:
For information on writing SQL statements that modify databases, consult a Transact-SQL manual.
For example, below is an Insert statement that contains three SQL variables. The values of these variables are provided by URL parameters passed to the page, as defined in the Run-time Value column of the Variables area.
After you close the dialog box, Dreamweaver inserts ASP code in your page that, when run on the server, creates a command that inserts, updates, or deletes records in the database.
By default, the code sets the Prepared property of the Command object to true
, which makes the application server reuse a single compiled version of the object every time the command is run. To change this setting, switch to Code view and change the Prepared property to false
.
In the above example, next you would probably create a page with an HTML form so users could enter record data. The HTML form would contain three text fields (txtCity, txtAddress, and txtPhone) and a submit button. The form would use the GET
method and submit the text field values to the page containing your command.