IV. IMPLEMENTATION OF THE DATA CALL
A. Data Connection Mode
Using 3 basic interfaces (_ConnectionPtr,
_CommandPtr, _RecordsetPtr ) of ADO, the system
executes SQL statements to input, read and update the
database respectively [5].
B. Implementation Procedure of the Data Call
1) Import the ADO Library
The dynamic link library msado15.dll needs to be
imported while ADO is used.
2) Initialize OLE / COM Library Environment
ADO library is a set of COM dynamic library, it must
be initialized before calling the ADO [6]. And OLE / COM
library environment should be initialized in InitInstance
member function of main MFC application program.
3) Connect to the Database
Define and use m_pConnection of ConnectionPtr
variable to connect database [7-8].
4) Operate Data Sets
Define and use m_Recordset of _RecordsetPtr variable
to read data. Call Open to execute SQL statements, then
user can open and operate data groups to achieve record
addition, record deletion, record modification functions.