尿液分析试纸行业标准:如何在vc里使用mysql

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/30 03:49:27
我安装了mysql odbc的驱程,并在odbc里添加了数据源,在vc的include里也已经包括了mysql的头文件,但为什么我下面的代码编译不过
#include <stdio.h>
#include <mysql.h>
int main()
{MYSQL mysql;
MYSQL_RES *result;
MYSQL_ROW row;
mysql_init(&mysql);
mysql_real_connect(&mysql,"localhost","root","","temp",0,NULL,0);
mysql_query(&mysql,"select name from users");
result=mysql_store_result(&mysql);
while((row=mysql_fetch_row(&mysql)))
{fprintf(stdout,"%s\n",row[0]);}
mysql_free_result(result);
mysql_close(&mysql);
}
各位朋友请帮帮忙