我用delphi7 , ado ,mysql连接数据库
在家里可以写数据库
在公司里只要一写数据库就出现
project project1.exe raised exception class EOLeException with message '[mysql][odbc 3.51 Driver][mysqld-3.23.57]you have an error in your SQL syntax near';'guest_name'='xiaomin' at line 1'.
process stopped.Use Step or Run to continue.这是怎么回事啊?
在家里可以写数据库
在公司里只要一写数据库就出现
project project1.exe raised exception class EOLeException with message '[mysql][odbc 3.51 Driver][mysqld-3.23.57]you have an error in your SQL syntax near';'guest_name'='xiaomin' at line 1'.
process stopped.Use Step or Run to continue.这是怎么回事啊?
=======================
可能是SQL语句的问题
adotable1.Open;
adotable1.Append;
adotable1.FieldByName('guest_num').AsInteger:=strtoint(edit1.text);
adotable1.FieldByName('guest_name').AsString:=edit2.Text;
adotable1.Post;
运行可以
但是一提交就出现如下警告:project project1.exe raised exception class EOLeException with message '[mysql][odbc 3.51 Driver][mysqld-3.23.57]you have an error in your SQL syntax near';guest('guest_num','guest_name'),values('22','xiaomin') at line 1'.
process stopped.Use Step or Run to continue.
在家里就可以 啊,数据类型和家里完全一样
update,insert,delete
adotable1.Append;
adotable1.FieldByName('guest_num').NewValue:=strtoint(edit1.text);
adotable1.FieldByName('guest_name').NewValue:=edit2.Text;
adotable1.Post;