Recently wrote some technical articles, only because of recent research more things, some projects used, so their own record, afraid of their own forgotten, if any students have their own views, can mail or reply, technical class discussion, whether or not, are welcome.
Before the operation, there must be a visual Studio 2013, other platform that I did not study, the operating system I used is Windows 8 Ultimate 64bit.
Back to the point, VC database programming operation database MySQL, using ODBC driver interface.
Instead of using MySQL's own C or C + + interface.
Install the database, you can download a large installation package here, including MySQL server and a large number of ODBC and JDBC, and other drivers.
http://dev.mysql.com/downloads/connector/odbc/
The next station that I said before has been done, the specific coding operations are as follows, and the entire series I will as far as possible involve more and deeper:
Visual C + + 2008 for MySQL Programming (ODBC)--Two operational databases
Visual C + + 2008 for MySQL Programming (ODBC)--Three querying the database
Visual C + + 2008 for MySQL Programming (ODBC)--(iv) derivation of the ultimate implementation CRecordset
Visual C + + 2008 for MySQL Programming (ODBC)--(iv) derivation of the ultimate implementation CRecordset
Visual C + + 2008 for MySQL Programming (ODBC)--(iv) The ultimate implementation of derivation CRecordset
I do not like typing, writing code also do not like comments, hehe, hanging silk habit bar.
The first is to install the database, the installation process will require the configuration of the database, configure the root user
After logging in, create the database Custemer, which contains two column--cust_id (int), Cust_name (char (100)):
OK, insert several entries:
Casually insert the entry, the content does not matter. hehe.
Configure the MySQL database ODBC driver, Control Panel-management tool-Data Source (ODBC):
Click Add to find the MySQL driver.
It is important to note that this cannot be added to the System DSN, my system is win8 64-bit, you will be prompted: Specifies that the architecture mismatch between the driver and the application in DSN must be added in the user DSN
、
Select to
When you are done, add the following:
Enter the configuration and click Test, which should be the day out of the window to succeed.
Open vc2013, locate the tool, connect to the database,
To add a database:
Select MySQL Database:
The configuration is as follows:
Test connection, should be successful.
Here's the article, the work of coding, the next stop.
Said before the next station has been done, the specific code operation is as follows:
Visual C + + 2013 for MySQL programming (ODBC)--Two
Visual C + + 2013 for MySQL programming (ODBC)--(i) Package installation