Building Pages With Advanced Data Manipulation Objects (Coldfusion, Asp, Asp.net, Jsp) - Adobe 38040334 - Dreamweaver CS3 User Manual

Pc
Hide thumbs Also See for 38040334 - Dreamweaver CS3:
Table of Contents

Advertisement

Dreamweaver adds a server behavior to the page that lets users delete records in a database table by clicking the
Submit button on the form.
Building pages with advanced data manipulation
objects (ColdFusion, ASP, ASP.NET, JSP)
About ASP command objects
An ASP command object is a server object that performs some operation on a database. The object can contain any
valid SQL statement, including one that returns a recordset, or one that inserts, updates, or deletes records in a
database. A command object can alter the structure of a database if the SQL statement adds or deletes a column in a
table. You can also use a command object to run a stored procedure in a database.
A command object can be reusable, in the sense that the application server can reuse a single compiled version of
the object to execute the command a number of times. You make a command reusable by setting the Prepared
property of the Command object to
mycommand.Prepared = true
If you know the command will be executed more than a few times, having a single compiled version of the object can
make database operations more efficient.
Note: Not all database providers support prepared commands. If your database does not support it, it might return an
error when you set this property to
property to
.
false
A command object is created by scripts on an ASP page, but Dreamweaver lets you create command objects without
writing a line of ASP code.
Use ASP commands to modify a database
You can use Dreamweaver to create ASP command objects that insert, update, or delete records in a database. You
supply the command object with the SQL statement or stored procedure that performs the operation on the database.
In Dreamweaver, open the ASP page that will run the command.
1
2
Open the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button, and select Command.
Enter a name for the command, select a connection to the database that contains the records you want to edit, and
3
select the editing operation that you want the command to perform—Insert, Update, or Delete.
Dreamweaver starts the SQL statement, based on the type of operation you select. For example, if you select Insert,
the dialog box looks like the following example:
, as in the following VBScript statement:
true
. It might even ignore the request to prepare the command and set the Prepared
true
September 4, 2007
DREAMWEAVER CS3
651
User Guide

Advertisement

Table of Contents
loading

This manual is also suitable for:

Dreamweaver cs3

Table of Contents