One of the Detailed ODBC Database Technology Application Source Program (Serial Data Save Related) ◆ Gong Jianwei Technology Home ◆ Xiong Guangming Gong Jianwei serial port Tongxun (program source code), serial debug assistant, port network communication technology, VC / C programming, mobile robot control Related Art, MATLAB Simulation and Data Processing Abstract: This article details the programming application of ODBC database technology in VC by example. The database source is Access. This article download Database1.zip 47kb vc6.0 Win9x / 2000 We have to save various real-time received data when programming, and reproduce playback for future data, and this data file can be used with ordinary files. Reading and writing, but when the data type is more and the data is required to play back data, it is required to set up a larger dynamic array when programming, which takes up more system resources, and even cause the program to crash; and use the database to better solve it. This problem, we put the data into the data source file and access it through the programming interface. ODBC (Open Database Connection: Open Database Connectivity provides a unified programming interface for various types of database management systems, we first illustrate the application method of ODBC technology by instance, and then explain how to put serial port Data Real-Time Save in Data Source Files, this aspect provides the application of ODBC technology in the VC (the previous example does not involve serial technology, so that you only want to know readers of ODBC technology, but also provide examples with ODBC technology to save serial programming data, Although several routines are not related to serial communication, if you are not familiar with the use of the database, please see patiently from the front. 1. First in the control panel, open the ODBC data source, click the user DSN option, appear Click Add in the interface, as shown below: Then, click the completion button, appear below, fill in the data source (can be named freely, this point is set to BIAO) Click OK. 2. Create a database in Access In this example, the DATA (only Number, Name, Score) can be provided under this example I provide. Copy 3. Establish an application item (1) Open the new option of the File menu, select Projects, select MFC AppWizard Exe, fill in the engineering name, this example is to copy database file DATA to the new project directory. (3) The type of application is specified as SDI, select Header Files Only option in the Step2 dialog, in step6 Is the view base class to cscrollView. (4) Create a recordset with ClassWizard. Select New from the Add Class menu and press the picture fill the dialog box: (Description: A CRecordset object represents a record from the data source Set.) (5). Click OK, enter Data Source, select the BIAO data source, and select the Dynast option, as shown below: After selecting the data source, the ClassWizard prompts us to select a table.