//选择创建后的数据库
              if (mysql_select_db(&mysql,database) != NULL)
  {
                       MessageBox(NULL,"Select DataBase Failed!","Error",MB_OK);
                       return -1;
              } 
           //在创建的数据库里创建数据表
 cSQL = "CREATE TABLE IF NOT EXISIS equipment_table(id int(11) not null auto_increment,\
                                channel_num int(16),\
 enable int,\
equipment_name varchar(30),\
manufacturer varchar(30),\
ip varchar(20),\
mac varchar(30),\
tcp_port int,\
    rtsp_port int,\
http_port int,\
user varchar(30),\
     primary key (id))";  if (mysql_query(&mysql,cSQL)!=NULL) 
{
MessageBox(NULL,"create equipment_table table failed!","Error",MB_OK);
return -1;
}

解决方案 »

  1.   

    谁能帮我解释解释if (mysql_query(&mysql,cSQL)!=NULL)  
    {
    MessageBox(NULL,"create equipment_table table failed!","Error",MB_OK);
    return -1;
    }执行时总是创建失败呢
      

  2.   

    CREATE TABLE IF NOT EXISIS->
    CREATE TABLE IF NOT EXISTS
      

  3.   

    EXISTS拼写错误,修改
     cSQL = "CREATE TABLE IF NOT EXISTS equipment_table(id int(11) not null auto_increment,\
    ...