这是一个没有返回集的SQL语1句。
所以不能用OPEN。
没有返回集的SQL语句执行只能用execSql.
把
query1.open;
换成
query1.execSql
就OK了。
所以不能用OPEN。
没有返回集的SQL语句执行只能用execSql.
把
query1.open;
换成
query1.execSql
就OK了。
解决方案 »
- delphi7 DBgrid的问题!
- TIdHTTP下载问题
- 如何获得与CheckBox一行的纪录?
- 我在调试时出现了一个窗体错误,本人不知所措。那位仁兄可曾见过这个现象,如可解决。(在线急求)
- 请问下ComboBox控件怎么响应右边那个有一个向下三角形按纽的事件啊
- 将代码转换成C++ Builder代码,在线等,
- 从数据库表中取得用户名的登录窗体,如何判断和密码匹配?
- *********如何生成ftDataSet型的字段*********
- 为什么双击listbox控件的第二项时,会有list index out of bounds(-1)的错误提示,如何解决?谢谢!
- 各位大虾,有谁知道如何遍历一个目录下的文件,包括子目录(重谢)
- ADO联接数据库的问题(广域网)
- 反编译问题!有什么好的反编译软件!再那下载??
大哥,我试了,还是不行,仍然提示期待select,update等等,怎么回事呀,另外我用的是access库,字段的类型那样设置对吗?
query1.open;
换成
query1.execSql
就OK了。
大哥,我试了,还是不行,仍然提示期待select,update等等,怎么回事呀,另外我用的是access库,字段的类型那样设置对吗?
(gqdm integer null,
gqmc string null,
savepath string null,
yypath string null);
你的是不是少了一对句号???????????????
query1.close;
query1.sql.Text := Format('create table %s (gqdm integer null,gqmc varchar(10) null,savepath varchar(20) null,yypath varchar(2) null)' , [trim(edit1.text)]);
query1.ExecSQL;还有,String 型可能不能用,改为varchar吧, 很少有数据库会直接用String这样的数据类型,虽然char和varchar实际上都是string, 但很少显示地标识为string
先要执行query1.ExecSQL;
执行储存过程要先
query1.Prepare;
query1.ExecProc;
TempSQL:string;
.
.
.
TempSQL:=format(' create %s (gqdm integer null, gqmc VARCHAR null,savepath VARCHAR null,yypath VARCHAR null )',[trim(edit1.text);]);
query1.close;
query1.sql.clear;
query1.sql.add(TempSQL);
query1.ExecSQL;
你的错误:1,query1.open;改为query1.ExecSQL;2,create 表命令格式错3。ACCESS的字符长类型是VARCHAR 而不是string
另外,我建议你用delphi的sql explore跟踪程序,好多错误好查出原因来
你试试可以上面的办法
query1.sql.clear;
query1.sql.add('create table :nm (gqdm integer null,gqmc string null,savepath string null,yypath string null)' );
query1.ParamByName('nm').asstring:= trim(edit1.text);
query1.execsql;
query1.sql.clear;
query1.sql.add('create table :nm (gqdm integer null,gqmc string null,savepath string null,yypath string null)' );
query1.ParamByName('nm').asstring:= trim(edit1.text);
query1.execsql;
query1.sql.clear;
query1.sql.add('create table :nm (gqdm integer null,gqmc string null,savepath string null,yypath string null)' );
query1.ParamByName('nm').asstring:= trim(edit1.text);
query1.execsql;