3
3dmm
Unregistered / Unconfirmed
GUEST, unregistred user!
下面程序段的目的是将某一个每行都有5列数据记录的txt文件的所有记录一行一行地转换到一个有5个字段的paradox表中,现在程序可以正常运行,数据也能正常导出到数据表的5个字段中,只可惜原本在一行的数据却被分在了5行上面,所以请各位专家帮忙看看程序的错误:
procedure TForm1.Button1Click(Sender: TObject);
var
i,j:integer;
myline:string;
begin
with table1 do
begin
open;
for i:=0 to richedit1.lines.count-1 do
begin
myline:=regulatestr(richedit1.lines,space);
for j:=1 to getsubstrnum(myline,space) do
begin
append;
Fields[j-1].AsString:=getsubstr(myline,space);
post;
end;
end;
close;
end;
end;
先行谢过您的帮助!!!
procedure TForm1.Button1Click(Sender: TObject);
var
i,j:integer;
myline:string;
begin
with table1 do
begin
open;
for i:=0 to richedit1.lines.count-1 do
begin
myline:=regulatestr(richedit1.lines,space);
for j:=1 to getsubstrnum(myline,space) do
begin
append;
Fields[j-1].AsString:=getsubstr(myline,space);
post;
end;
end;
close;
end;
end;
先行谢过您的帮助!!!