我要复制access数据库中的一个结构完全一样的表,但出现了让我头疼的问题,有三种情况,请看:(100分)

  • 主题发起人 主题发起人 明月剑
  • 开始时间 开始时间
select * into a from b 我用的就是这一句,但在运行过程中,它问我要DAOquery.pas
我应该如何解决?
 
你要把diamond源码所在路径包含进去啊
 
你要把diamond源码所在路径包含进去啊,怎么包含进去,(够菜吧)谢谢!
 
to 左轻候:

同意你的意思, BDE 的低版的确可能出上述问题,

Diamond Access ,的 1.97 , 在98 or 2000 下正常 ,

在 95 下就会说出错. DAO 的版本也设对了.

还有一个小问题. 就是你怎么能用 Diamond Access, 把一个 A.mdb 中的表 AA的记录

APPendupdate. or update 到一个 B.mdb 的表 BB 中去? ODBC , 太慢 ,BDE不行.
 
除了用Diamond Access,就没有别的办法!
 
我用ado时出错,代码如下:
adoquery1.SQL.Clear;
adoquery1.SQL.Add('select * into a from b');
adoquery1.Open;
运行时出错:
'commandtext does not return a result set'
我要疯了.程序快编完了,却出现了这样的问题!
 
不返回数据集的query不能用open,要用ADOQuery.ExecSQL
 
我用这个程序把问题解决了,但遗憾的是,小数位还是自动的。如果有高手能解决,请
与我联系:
procedure tfrmfm.QuickCopyTable(T: TTable;DestTblName: string; Overwrite: Boolean);
var
DBType: DBINAME;
WasOpen: Boolean;
NumCopied: Word;
begin
//save table active state
WasOpen := T.Active;
if not WasOpen then T.Open; //ensure the table is open
//Get driver type string
Check(DbiGetProp(hDBIObj(T.Handle), drvDRIVERTYPE, @DBType, SizeOf(DBINAME), NumCopied));
//Copy the table
Check(DBICopyTable(T.DBHandle, Overwrite, PChar(T.Tablename),
DBType, PChar(DestTblName)));
//Restore active state
T.Active := WasOpen;
end;
接受答案,谢谢大家。
 
多人接受答案了。
 
试试用creat tablename as select * from old_tablename;
 
后退
顶部