ACCESS数据库初始化(0分)

  • 主题发起人 主题发起人 Clearboy
  • 开始时间 开始时间
C

Clearboy

Unregistered / Unconfirmed
GUEST, unregistred user!
我先得以数据库中的表格名称,然后在一个个删除其中的东西,怎么出现Exception啊!
 
你的code?
有没有升级ado2.7
 
var str:tstringlist;
i,j:integer;
adotable1:tadotable;
begin
str:=tstringlist.Create;
adotable1:=tadotable.create(self);
adotable1.connection:=adoconnection1;
adoconnection1.GetTableNames(str,false);
for i:=0 to str.Count-1 do
begin
adotable1.TableName:=str;
for j:=0 to adotable1.recordcount-1 do
adotable1.delete;
end;
end;
 
var str:tstringlist;
i,j:integer;
adotable1:tadotable;
begin
str:=tstringlist.Create;
adotable1:=tadotable.create(self);
adotable1.connection:=adoconnection1;
adoconnection1.GetTableNames(str,false);
for i:=0 to str.Count-1 do
begin
adoquery1.sql.text:='delete from ' +str ;
adoquery1.execsql
end;
end;
 
谢提醒,我忘记了,SQL这个强大的工具!前面Var也要改一下!
你的QQ能告诉我吗?
QQ:35098814
 
后退
顶部