Wednesday, March 6, 2013

MFC ODBC Classes


MFC ODBC Classes:
Like windows, MFC make use of object to MFC classes. There are two MFC ODBC classes CRecordset & CDatabase.
Object of CDatabase class represents the ODBC connection to data source. The object of CRecordset class represents the scrollable rowset.
For supporting a database query, some derived class form CRecordset must be used.
The useful functionalities of MFC ODBC class CRecordset are:-


Function
Purpose
Open
Opens the record set.
AddNew
Prepares to add a new record to the table.
Delete
Deletes the current record from the recordset.
Edit
Prepares to implement changes on the current record.
Update
Completes an AddNew or Edit operation by saving the new or edited data in the data source.
IsBOF
Determines whether the recordset has been positioned before the first record.
IsEOF
Determines whether the recordset has been positioned after the last record.
MoveNext
Sets the current record to the next record or to the next rowset.
MoveFirst
Sets the current record to the first record in the recordset.
MoveLast
Sets the current record to the last record or to the last rowset.
MovePrev
Sets the current record to the previous record or to the previous rowset.
GetDefaultConnect
Gets the default connection string for the data source on which the recordset is based.
GetDefaultSQL
Gets the default SQL string.
DoFieldExchange
Exchanges data between the recordset data fields and the corresponding record on the data source.
GetStatus
Gets the index of the current record in the recordset and the final count status.
GetRecordCount
Determines the highest numbered record yet encountered as the user moves through the records.
GetODBCFieldCount
Gets the number of fields in the recordset object.
GetODBCFieldInfo
Gets information about the fields in the recordset.


MFC ODBC Class Database Relationship:



0 comments:

Post a Comment

Powered by Blogger.