Ado控件實現建TXT文本文件(100分)

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

Unregistered / Unconfirmed
GUEST, unregistred user!
with Table1 do
begin
Active := False;
DatabaseName := edit1.Text;
TableType := ttASCII;
TableName := formatdatetime('yyyymmdd',Datetimepicker1.DateTime)+'n.txt';
end;
if table1.exists then
table1.DeleteTable;

with Table1 do
begin
Active := False;
with FieldDefs do
begin
Clear;
with AddFieldDef do
begin
Name := 'name';
DataType := ftstring;
size:=19;
end;
end;
CreateTable;
end;

table1.Active:=false;
//table1.fieldbyname('name').DisplayLabel:='卡記錄';
table1.Active:=true;
query1.DisableControls;
query1.First;
while query1.Eof=false do
begin
table1.Append;
s:=copy('00000000',1,7-length(query1cardid.AsString))+query1cardid.AsString;
s:=s+formatdatetime('yyyymmddhhmm',strtodatetime(query1checkdate.AsString));
table1.FieldByName('name').AsString:=s;
query1.Next;
table1.Post;
end;
query1.first;
query1.EnableControls;
table1.active:=false;
table1.Active:=true;


用bde 的Table可以實現這樣的功能,如果用ado怎麼做呢
 
沒人會嗎
 

Similar threads

后退
顶部