易截截图软件、单文件、免安装、纯绿色、仅160KB

在visual studio c++中如何调用mysql语句

[b]先说声我是新手,  我的mysql数据库已经连上了vs , 但后续我要用c++语言直接操作数据库, 或能不能调用mysql的语句来对其操作, 各位大侠帮帮忙,可以的话提供点代码例子参考一下,先谢谢各位了。

一般建议用MySQL的C API进行开发

官方的:http://dev.mysql.com/downloads/connector/


C++ 有几种连法,看你具体安装的connector 是什么了。你可以用 C++ connector ,也可以用 C API, 或者ODBC。

建议你可以到MYSQL的官方的文档中查看这些例子。楼上贴出的就是从官方文档中摘抄的例子。

http://dev.mysql.com/doc/refman/5.1/en/connectors-apis.html
Chapter 21. Connectors and APIs


Chapter 21. Connectors and APIs
http://dev.mysql.com/doc/refman/5.1/en/connectors-apis.html

21.1. MySQL Connector/ODBC    [+/-]
21.2. MySQL Connector/NET    [+/-]
21.3. MySQL Connector/J    [+/-]
21.4. MySQL Connector/MXJ    [+/-]
21.5. MySQL Connector/C++    [+/-]
21.5.1. MySQL Connector/C++ Binary Installation
21.5.2. MySQL Connector/C++ Source Installation
21.5.3. MySQL Connector/C++ Building Windows applications with Microsoft Visual Studio
21.5.4. MySQL Connector/C++ Building Linux applications with NetBeans
21.5.5. MySQL Connector/C++ Getting Started: Usage Examples
21.5.6. MySQL Connector/C++ Tutorials
21.5.7. MySQL Connector/C++ Debug Tracing
21.5.8. MySQL Connector/C++ Usage


相关问答:

C、C++、VC++ 精品电子书发布啦!

内容涉及:C、C++、STL、VC++、MFC、COM、ATL、Windows网络编程、数据库编程、Windows驱动编程、软件工程、Windows操作系统编程,等等方面。

下载地址:http://www.cctry.com/forumdisplay.php?fid=46

......

mysql的连接超时时间怎么设置 - VC/MFC / 数据库

我是用mysql自带的C API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))

AfxMessageBox("数据库连接失败") ......

mysql的驱动程序

我有一个java环境下的程序,在本机运行正常,但发布到网的虚拟主机时不能连接数据库连接池
jdk 1.6 tomcat6.0.18 mysql5 mysqljdbc5.1.5
虚拟主机的技术人员说,只能配置局域的数据库连接池,也就是在M ......

MYSQL安装失败

我以前安装了一次,后来卸载了,现在再安装的时候,提示错误:Error 1305.Error reading from file C:DOCUME~1\LOCALS~1\Temp\mysql_server.msi.Verify that the file exists and that you can access it.
可是我找 ......

c语言如何连接MYSQL?

大家好:
我是搞C的, 现在想用C 连接MYSQL,但是怎么也连接不了,我的代码如下:
#include <stdio.h>
#include "C:\Program Files\MySQL\MySQL Server 5.0\include\mysql.h"
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号