示例#1
0
	/**
	 * Returns a float associated with the passed in field/ column for the current row.
	 *
	 * @param	Column	Name of column to retrieve data for in current row
	 */
	virtual FLOAT GetFloat( const TCHAR* Column ) const
	{
		FLOAT ReturnValue = 0;
		try
		{
			// Retrieve specified column field value for selected row.
			_variant_t Value = ADORecordSet->GetCollect( Column );
			// Check variant type for validity and cast to specified type. _variant_t has overloaded cast operators.
			if( Value.vt != VT_NULL )
			{
				ReturnValue = (FLOAT)Value;
			}
			// Unknown column.
			else
			{
				debugf(NAME_DevDataBase,TEXT("Failure retrieving FLOAT value for column [%s]"),Column);
			}
		}
		// Error handling. Will return default value of 0.
		catch( _com_error& Error )
		{
			debugf(NAME_DevDataBase,TEXT("Failure retrieving FLOAT value for column [%s] [%s]"),Column,(TCHAR*) Error.Description());	
		}
		return ReturnValue;
	}
示例#2
0
	/**
	 * Returns a string associated with the passed in field/ column for the current row.
	 *
	 * @param	Column	Name of column to retrieve data for in current row
	 */
	virtual FString GetString( const TCHAR* Column ) const
	{
		FString ReturnString;
		try
		{
			// Retrieve specified column field value for selected row.
			_variant_t Value = ADORecordSet->GetCollect( Column );
			// Check variant type for validity and cast to specified type. _variant_t has overloaded cast operators.
			if( Value.vt != VT_NULL )
			{
				ReturnString = (TCHAR*)_bstr_t(Value);
			}
			// Unknown column.
			else
			{
				ReturnString = TEXT("Unknown Column");
			}
		}
		// Error handling. Will return string with error message.
		catch( _com_error& Error )
		{
			ReturnString = FString::Printf(TEXT("Failure retrieving string value for column [%s] [%s]"),Column,(TCHAR*) Error.Description());
			debugf(NAME_DevDataBase,TEXT("%s"),*ReturnString);
		}
		return ReturnString;
	}