unsigned int i = 0;
MYSQL      * conn;   //连接
MYSQL_RES  * result; //SELECT查询的结果
MYSQL_ROW  row ;     //SELECT查询的一条记录//建立一个到 MYSQL 的连接
conn = mysql_init(NULL);
mysql_real_connect(conn,0,"root","1","jxc",3306,0,0); 
mysql_query(conn,"set names 'gb2312'");wchar_t  wstr_spmc[200];::ZeroMemory (wstr_spmc,400);
GetDlgItemTextW (IDC_COMBO1,wstr_spmc,50);//获得组合框中的商品名称

char  cstr_spmc[200];::ZeroMemory (cstr_spmc,200);
int nSize = ::WideCharToMultiByte(CP_OEMCP, 0, wstr_spmc, -1, cstr_spmc, 0, 0, 0);

::WideCharToMultiByte (CP_OEMCP,0,wstr_spmc,-1,cstr_spmc,nSize,0,0);

//开1000个char
char constMingLing [1000];::ZeroMemory (constMingLing,1000);
//把常量复制到一千个char中
strcpy(constMingLing,"insert into 入库登记表 (商品名称) values(");
//连接商品名称
strcat( constMingLing,cstr_spmc);
//连接右括号
strcat(constMingLing,")");
//执行插入命令
mysql_query(conn,constMingLing);

mysql_close(conn);