F
fscdc4
Unregistered / Unconfirmed
GUEST, unregistred user!
如果没有表newfile,则从fromfile表复制到newfile,我的代码如下:<br>procedure Tgrobalsform.tonewtable1(fromfile:string;newfile:string); //保存code<br>var sqlstr:string;<br>begin<br> newfileADOquery.close;<br> newfileADOquery.sql.clear;<br> sqlstr:='IF Not Exists(';<br> sqlstr:=sqlstr+'SELECT * FROM syscolumns WHERE (id = OBJECT_ID(N'+quotedstr(newfile)+')) ';<br> sqlstr:=sqlstr+' BEGIN ';<br> sqlstr:=sqlstr+'select * into '+newfile+' from '+fromfile;<br> sqlstr:=sqlstr+' END ';<br> newfileADOquery.sql.add(sqlstr);<br> try<br> newfileADOquery.execsql;<br> except<br> exit;<br> end;<br> newfileADOquery.close;<br>end;<br>编译出错,begin 附近有语法错误,请给出正确的代码