<cf_datasource>

Add, edit, and list Cold Fusion Compliant ODBC datasources on your Cold Fusion Server. Supports SQL Server, and Access Databases. This custom tag contains nearly all the tools needed to build a custom datasource administrator, similar to the one that Comes with Cold Fusion. Supports every possible ODBC and Cold Fusion database attribute, and can return all the options in the a query.

Attribute

Value

Type

Description

action [add/edit/list/listall] Default is add Decides what the tag will do. "add" adds a datasource, "edit" edit's a datasource, list returns a query with information about a datasource, and listall returns a query with information about all the datasources.
engine [access/sqlserver] Default is access Specifies which which database engine the datasource is, and applies the proper changes.
db [path]/database No default For an Access database you specify the path on your computer to the database.  For a SQL Server database, you specify the name of the database.
dsn [text] Required for action="add, or edit, or list" Data Source Name.
description [text] No default Datasource description.
Cold Fusion Datasource Attributes
allowallsql [0/1] Default is 1 Allow all SQL statements, will override other sql options
maintainconnect [0/1] Default is 1 Maintain Connection
allowiuactions [0/1] Default is 1 Allow IU Actions
disable_select [0/1] Default is 1 Disable SQL Select Statement the Allow All SQL attribute takes precedence over this setting.
disable_insert [0/1] Default is 1 Disable SQL Insert Statement the Allow All SQL attribute takes precedence over this setting.
disable_update [0/1] Default is 1 Disable SQL Update Statement the Allow All SQL attribute takes precedence over this setting.
disable_delete [0/1] Default is 1 Disable SQL Delete Statement the Allow All SQL attribute takes precedence over this setting.
connectiontimeout [number] Default is 30 (seconds) Cold Fusion Connection timeout
logintimeout [number] Default is 30 (seconds) Cold Fusion Login Timeout
limitconnections [0/1] Default is 0 Allows Cold Fusion to enforce the Max Connections attribute.  Don't turn this on, unless you have a good reason to.
maxconnections [number] Default is [blank] (unlimited) The maximum number of simultaneous connections to the Datasource
maxbuffersize [number] Default is 0 (unlimited) Set's the max size of the buffer
Common ODBC Attributes
driver [path] Defaults: "C:\WINNT\System32\SQLSRV32.DLL" for SQL Server, and "C:\WINNT\System32\odbcjt32.dll" for access

The location on the cold fusion server that contains the ODBC Drivers for the Database Engine
Access Only ODBC Attributes (engine="access")
systemdb [text] Default [blank] System Database
driverid [DWORD] Default 19 Driver id
fil [text] Default "MS Access" FIL Attribute
JetPageTimeout [number] Default is 200 Page Timeout for Jet Driver
SQL Server Only ODBC Attributes (engine="sqlserver")
Server [servername] Default: (local) The name of the SQL Server that the database resides on.
trustedconnection [0/1] Default is 0 Use Trusted Connection
oemtoansi [Yes/No] Default is "Yes" Convert OEM to ANSI Characters
useprocforprepare [Yes/No] Default is "Yes" Generate stored procedure for prepared statement.
Other Attributes
queryname [text] Required for action="listall, and list" The name of the query that will contain the datasource information

 
Example Code

Although there are a lot of options in this tag, most of them are optional, leaving them blank will result in the defaults that cold fusion uses.

Action="add"

Action="edit" Action="list" Action="listall"
The variables that are available in the query returned for action="list" or action="listall" have been named the same names as the input attributes. So if you want to know what the maxbuffersize is, then use #maxbuffersize# in your query.

© 1999-2001 CFDEV.COM.