User Guide
300 Developing Web Applications with ColdFusion
virtual void WriteDebug( LPCSTR lpszOutput )
CCFXRequest::WriteDebug writes text output into the debug stream.
virtual CCFXStringSet* CreateStringSet()
CCFXRequest::CreateStringSet allocates and returns a new CCFXStringSet
instance.
virtual void ThrowException( LPCSTR lpszError, LPCSTR lpszDiagnostics )
CCFXRequest::ThrowException throws an exception and ends processing of this
request.
virtual void ReThrowException( CCFXException* e )
CCFXRequest::ReThrowException re-throws an exception that has been caught.
virtual void SetCustomData( LPVOID lpvData )
CCFXRequest::SetCustomData sets custom (tag specific) data to carry along with
the request.
virtual LPVOID GetCustomData()
CCFXRequest::GetCustomData gets the custom (tag specific) data for the request.
CCFXRequest::AddQuery
CCFXQuery* CCFXRequest::AddQuery(LPCSTR
lpszName
, CCFXStringSet*
pColumns
)
Adds a query to the calling template. This query can then be accessed by CFML tags
(for example,
CFOUTPUT or CFTABLE) within the template. Note that after calling
AddQuery, the query exists but is empty (that is, it has 0 rows). To populate the query
with data, you should call the CCFXQuery::AddRow and CCFXQuery::SetData
functions.
Returns a pointer to the query that was added to the template (an object of class
CCFXQuery). You are not responsible for freeing the memory allocated for the returned
query (it will be freed automatically by ColdFusion after the request is completed).
lpszName
Name of query to add to the template (must be unique).
pColumns
List of columns names to be used in the query.
Example
The following example adds a query named ’People’ to the calling template. The query
has two columns (’FirstName’ and ’LastName’) and two rows:
// Create a string set and add the column names to it
CCFXStringSet* pColumns = pRequest->CreateStringSet() ;
int iFirstName = pColumns->AddString( "FirstName" ) ;
int iLastName = pColumns->AddString( "LastName" ) ;