Specifying Data Sources Dynamically - MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual

Table of Contents

Advertisement

24
Adding data source notes and considerations
When adding data sources to ColdFusion Server, keep these guidelines in mind:

Specifying data sources dynamically

To specify a data source dynamically, use the following attribute in the
dbtype = "dynamic"
Specify all the required ODBC connection information, including the ODBC driver
and the database location, in the
use the following code for a query that dynamically specifies the pubs database on a
local Microsoft SQLServer:
<cfquery name = "datelist"
</cfquery>
The following example uses a Microsoft Access database:
<cfquery name="titles"
</cfquery>
Data source names should be all one word and begin with a letter.
Data source names can contain only letters, numbers, and the underscore.
Data source names should not contain special characters.
Although data source names are not case-sensitive, you should use a consistent
capitalization scheme.
A data source must exist in the ColdFusion Administrator before you use it on an
application page to retrieve data (unless you specify the data source
dynamically).
dbtype = "dynamic"
blockfactor = 100
connectstring = "DRIVER={SQLSERVER};SERVER=(local);UID=sa;PWD=;
DATABASE=pubs">
SELECT * FROM authors
dbtype = "dynamic"
ConnectString="DRIVER=Microsoft Access Driver (*.mdb);
DBQ=C:\CFusion\Database\cfsnippets.mdb;DriverId=281;
FIL=MS Access;MaxBufferSize=2048;PageTimeout=5">
SELECT * FROM Courses
Chapter 3 Querying a Database
attribute. For example, you could
connectstring
tag:
cfquery

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 5-DEVELOPING and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 5

Table of Contents