S
sxd2002
Unregistered / Unconfirmed
GUEST, unregistred user!
begin
if fileexists('c:/temp/d14064.txt') then begin
FlatButton2.Enabled:=false;
Screen.Cursor:=CrhourGlass;
// adotable1.DatabaseName:='c:/temp';
adotable1.Connection:=ADOConnection1;
adotable1.TableName:='ckdb';
adotable1.Active:=true;
adotable1.Edit;
lines:=Tstringlist.Create;
lines.LoadFromFile('c:/temp/d14064.txt');
for i:=0 to pred(lines.Count-1) do begin
adotable1.Append;
s:=lines;
s2:=copy(s,10,16);
adotable1.FieldByName('lnkh').Value:=s2;
s2:=copy(s,40,12);
adotable1.FieldByName('cksj').Value:=s2;
s2:=copy(s,88,10);
adotable1.FieldByName('tzsj').Value:=s2;
try
adotable1.Post;
except
// on EDBEngineError do begin
// on EDBEngineError do begin
// messagebox(handle,'写数据库失败.','失败',0);
// adotable1.Cancel
adotable1.Cancel;
// adotable1.Edit;
continue;
// end;
end;
end;
lines.Free;
showmessage('装入文本文件成功!');
end else begin
showmessage('没有找到可转换的文本文件');
end;
Screen.Cursor:=Crdefault;
adotable1.Active:=false;
end;
****************************
数据是插入到表里面了,就是为什么鼠标总是:Screen.Cursor:=CrhourGlass
并且没有显示 '装入文本文件成功!'
帮我!
if fileexists('c:/temp/d14064.txt') then begin
FlatButton2.Enabled:=false;
Screen.Cursor:=CrhourGlass;
// adotable1.DatabaseName:='c:/temp';
adotable1.Connection:=ADOConnection1;
adotable1.TableName:='ckdb';
adotable1.Active:=true;
adotable1.Edit;
lines:=Tstringlist.Create;
lines.LoadFromFile('c:/temp/d14064.txt');
for i:=0 to pred(lines.Count-1) do begin
adotable1.Append;
s:=lines;
s2:=copy(s,10,16);
adotable1.FieldByName('lnkh').Value:=s2;
s2:=copy(s,40,12);
adotable1.FieldByName('cksj').Value:=s2;
s2:=copy(s,88,10);
adotable1.FieldByName('tzsj').Value:=s2;
try
adotable1.Post;
except
// on EDBEngineError do begin
// on EDBEngineError do begin
// messagebox(handle,'写数据库失败.','失败',0);
// adotable1.Cancel
adotable1.Cancel;
// adotable1.Edit;
continue;
// end;
end;
end;
lines.Free;
showmessage('装入文本文件成功!');
end else begin
showmessage('没有找到可转换的文本文件');
end;
Screen.Cursor:=Crdefault;
adotable1.Active:=false;
end;
****************************
数据是插入到表里面了,就是为什么鼠标总是:Screen.Cursor:=CrhourGlass
并且没有显示 '装入文本文件成功!'
帮我!