Overview

COLEDatabase is not derived from any other class

A COLEDatabase class is used to open a Microsoft Access or SQL database.


Constructor

There are no parameters allowed.


Class Members

CString FormatDateTime( COleDateTime &ts ) Return the correct format for a date and time to be used in a search.
SQL - 2001-01-31 23:59:59
Access - floating point
const TCHAR *UpperCaseFunction() Returns the database function to convert a text string.
SQL - UPPER
Access - UCase
BOOL IsOpen( ) const Returns TRUE if database is open
BOOL IsSQL() const Returns TRUE if the database is SQL
BOOL IsReadOnly() const Returns TRUE if the database is read only
BOOL IsExclusive() const Returns TRUE if database is single user mode
virtual void Open(LPCTSTR lpszName, BOOL bExclusive = FALSE, BOOL bReadOnly = FALSE, LPCTSTR pszPassword = NULL ) Open a database for use. An COLEDBException or CException will be thrown if it fails. NOTE the lpszName can be a pathname or SQL if '>Server>Database' format is used.
virtual void Close() Close the Database
LONG Execute(LPCTSTR lpszSQL, int nOptions = 0) Executes an SQL statement. nOptions is not currently used. Returns the number of rows affected.
CSession& GetDataSession() Returns the Session associated with the database. This is used in data manipulation.
const CString& GetServer() const Return the name of the Server. Only Call if IsSQL() returns TRUE.
const CString& GetDatabase() const Return the name of the database opened.
CString GetFullPath() Returns either the disk path or >Server>Database