ADOQuery1.SQL.Add('Create table Plantemp as select * from planfile')出错?(30分)

T

ttaa

Unregistered / Unconfirmed
GUEST, unregistred user!
ADOQuery1.Close;
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('Select * into plantemp from planfile where false');
// ADOQuery1.SQL.Add('Create table Plantemp as select * from planfile');
ADOQuery1.ExecSQL;

我用的事Access。
我查过以前的得很多帖子,都说
create table newtablename as select * from oldtable会有问题的。
但好像都是不了了之。

ADOQuery1.SQL.Add('Select * into plantemp from planfile where false');
这句没有问题。
但是,索引阿,约束啊。都没了。
ADOQuery1.SQL.Add('Create table Plantemp as select * from planfile');
为什么错啊?
 
你用原生的ADO吧,要不用ADOCOMMAND试试.
 

ADOQuery1.SQL.Add('Create table Plantemp as select * from planfile');
对于 Oracle数据库应该没有问题。Access 不能解释该语句。所以会出错。
对于Access,sql sserver等微系列的数据库,用
ADOQuery1.SQL.Add('Select * into plantemp from planfile where false');
不同的数据库都有其自己的操作命令。

 
to wellknow:
adocommand不行。原生对象还没试。不过估计也不行。
to pcc_mmz1:
这样啊。那原来表的一些属性就没了?
真的事别无它法?
 
不行的话,那你就在后吧用存储过程吧.
 
无可奈何的接受答案
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
799
import
I
I
回复
0
查看
955
import
I
I
回复
0
查看
650
import
I
顶部