User Guide

104 The Database Connectivity API
When the user clicks OK in a connection dialog box, Dreamweaver calls the
applyConnection() function to build the HTML, which is placed in the connection include
file that is located in the Configuration/Connections folder. The
applyConnection()
function returns an empty string that indicates there is an error in one of the fields and the
dialog box should not be closed. The include file has the default file extension type for the
current server model.
When the user adds to the page a server behavior that uses the connection, such as a recordset
or a stored procedure, Dreamweaver adds a statement to the page that includes the connection
include file.
findConnection()
Availability
Dreamweaver UltraDev 4.
Description
Dreamweaver calls this function to detect a connection in the specified HTML source and to
parse the connection parameters. If the contents of this source file match the criteria for a
valid connection,
findConnection() returns a connection object; otherwise, this function
returns a
null value.
Argument
htmlSource
The htmlSource argument is the HTML source for a connection.
Returns
A connection object that provides values for a particular combination of the properties that
are listed in the following table. The properties for which this function returns a value depend
on the document type.
Property Description
name
Name of the connection
type
If useHTTP is false, indicates which DLL to use for connecting to
database at runtime
string
Runtime connection string. For ADO, it is a string of connection
parameters; for JDBC, it is a connection URL
dsn
Data source name used for ODBC or Cold Fusion runtime
connections
000_DW_API_Print.book Page 104 Wednesday, July 20, 2005 11:58 AM