
658
Chapter 30: Using Server-Side ActionScript
You use server-side ActionScript in ColdFusion MX to return record set data to a Flash MX client
from a ColdFusion MX data source. You specify the ColdFusion MX data source name and the
SQL statement you execute on the data source as arguments in the
CF.query
function in server-
side ActionScript.
Typically, your server-side ActionScript handles the interaction with the ColdFusion MX data
source, and returns a record set to the Flash MX client through the Flash Remoting service.
For more detailed information about ColdFusion MX data sources, see
Configuring and
Administering ColdFusion MX
.
Using the CF.query function
You use the
CF.query
function in your server-side ActionScript to retrieve data from a
ColdFusion MX data source. This function lets you perform queries against any ColdFusion MX
data source.
Note:
The
CF.query
function maps closely to the
cfquery
CFML tag, although it currently supports a
subset of the
cfquery
attributes.
Use the
CF.query
function to do the following:
•
Identify the data source you want to query.
•
Pass SQL statements to the data source.
•
Pass other optional parameters to the database.
For reference information about the
CF.query
function, see
CF.query
in
CFML Reference
.
About CF.query function syntax
You can write the
CF.query
ActionScript function using either named arguments or positional
arguments. The named argument style is more readable, but it requires more code. Although the
positional argument style supports a subset of
CF.query
arguments, it allows a more compact
coding style that is more appropriate for simple expressions of the
CF.query
function.
Using CF.query named argument syntax
The
CF.query
function accepts the following named arguments:
// CF.query named argument syntax
CF.query
({
datasource:"data source name",
sql:"SQL stmts",
username:"username",
password:"password",
maxrows:number,
timeout:milliseconds
})
Note:
The named argument style requires curly braces {} to surround the function arguments.
Содержание COLDFUSION MX 61-DEVELOPING COLDFUSION MX
Страница 1: ...Developing ColdFusion MX Applications...
Страница 22: ...22 Contents...
Страница 38: ......
Страница 52: ...52 Chapter 2 Elements of CFML...
Страница 162: ......
Страница 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Страница 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Страница 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Страница 266: ......
Страница 314: ...314 Chapter 14 Handling Errors...
Страница 344: ...344 Chapter 15 Using Persistent Data and Locking...
Страница 349: ...About user security 349...
Страница 357: ...Security scenarios 357...
Страница 370: ...370 Chapter 16 Securing Applications...
Страница 388: ...388 Chapter 17 Developing Globalized Applications...
Страница 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Страница 410: ......
Страница 426: ...426 Chapter 19 Introduction to Databases and SQL...
Страница 476: ...476 Chapter 22 Using Query of Queries...
Страница 534: ...534 Chapter 24 Building a Search Interface...
Страница 556: ...556 Chapter 25 Using Verity Search Expressions...
Страница 558: ......
Страница 582: ...582 Chapter 26 Retrieving and Formatting Data...
Страница 668: ......
Страница 734: ...734 Chapter 32 Using Web Services...
Страница 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Страница 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Страница 788: ......
Страница 806: ...806 Chapter 35 Sending and Receiving E Mail...