Whatever message this page gives is out now! Go check it out!
virtual int AddRow() | :AddRow adds a row to a query. |
virtual CCFXStringSet* GetColumns | :GetColumns retrieves a list of a query's column names. |
virtual LPCSTR GetData( int iRow, int iColumn ) | :GetData retrieves a data element from a row and column of a query. |
virtual LPCSTR GetName() | :GetName retrieves the name of a query. |
virtual int GetRowCount() | :GetRowCount retrieves the number of rows in a query. |
virtual void SetData( int iRow, int iColumn, LPCSTR lpszData ) | :SetData sets a data element within a row and column of a query. |
virtual void SetQueryString( LPCSTR lpszQuery ) | This function is deprecated. It might not work, and might cause an error, in later releases. |
virtual void SetTotalTime( DWORD dwMilliseconds ) | This function is deprecated. It might not work, and might cause an error, in later releases. |
int CCFXQuery::AddRow(void) |
// First row int iRow ; iRow = pQuery->AddRow() ; pQuery->SetData( iRow, iCity, "Minneapolis" ) ; pQuery->SetData( iRow, iState, "MN" ) ; pQuery->SetData( iRow, iZip, "55345" ) ; // Second row iRow = pQuery->AddRow() ; pQuery->SetData( iRow, iCity, "St. Paul" ) ; pQuery->SetData( iRow, iState, "MN" ) ; pQuery->SetData( iRow, iZip, "55105" ) ; |
CCFXStringSet* CCFXQuery::GetColumns(void) |
// Get the list of columns from the query CCFXStringSet* pColumns = pQuery->GetColumns() ; int nNumColumns = pColumns->GetCount() ; // Print the list of columns to the user pRequest->Write( "Columns in query: " ) ; for( int i=1; i<=nNumColumns; i++ ) { pRequest->Write( pColumns->GetString( i ) ) ; pRequest->Write( " " ) ; } |
LPCSTR CCFXQuery::GetData(int iRow, int iColumn) |
| Parameter | Description |
iRow | Row to retrieve data from (1-based) |
iColumn | Column to retrieve data from (1-based) |
int iRow, iCol ; int nNumCols = pQuery->GetColumns()->GetCount() ; int nNumRows = pQuery->GetRowCount() ; for ( iRow=1; iRow<=nNumRows; iRow++ ) { for ( iCol=1; iCol<=nNumCols; iCol++ ) { pRequest->Write( pQuery->GetData( iRow, iCol ) ) ; pRequest->Write( " " ) ; } pRequest->Write( "<BR>" ) ; } |
LPCSTR CCFXQuery::GetName(void) |
CCFXQuery* pQuery = pRequest->GetQuery() ; pRequest->Write( "The query name is: " ) ; pRequest->Write( pQuery->GetName() ) ; |
int CCFXQuery::GetRowCount(void) |
CCFXQuery* pQuery = pRequest->GetQuery() ; char buffOutput[256] ; wsprintf( buffOutput, "The number of rows in the query is %ld.", pQuery->GetRowCount() ) ; pRequest->Write( buffOutput ) ; |
void CCFXQuery::SetData(int iRow, int iColumn, LPCSTR lpszData) |
| Parameter | Description |
iRow | Row of data element to set (1-based) |
iColumn | Column of data element to set (1-based) |
lpszData | New value for data element |
// First row int iRow ; iRow = pQuery->AddRow() ; pQuery->SetData( iCity, iRow, "Minneapolis" ) ; pQuery->SetData( iState, iRow, "MN" ) ; pQuery->SetData( iZip, iRow, "55345" ) ; // Second row iRow = pQuery->AddRow() ; pQuery->SetData( iCity, iRow, "St. Paul" ) ; pQuery->SetData( iState, iRow, "MN" ) ; pQuery->SetData( iZip, iRow, "55105" ) ; |