我用本地的paradox表table1(此表已建立second index),通过query1从sqlsever中取数,能看到所要的结果,我再用本地的paradox表table2,取table1中的所有数据,结果却一个数据也没到,请问这是为什么?该如何做才能从table1中取到数据?
table2取table1数据过程:
table2.open;
table1.open;
for iCount1 := 0 to table1.RecordCount - 1 do
begin
table2.Append ;
table2.FieldByName('shuliang').asinteger:=table1.FieldByName('shuliang').asinteger;
table2.Post;
table1.next;
end;
table2取table1数据过程:
table2.open;
table1.open;
for iCount1 := 0 to table1.RecordCount - 1 do
begin
table2.Append ;
table2.FieldByName('shuliang').asinteger:=table1.FieldByName('shuliang').asinteger;
table2.Post;
table1.next;
end;
改为
while not table1.eof do
不行用batchmove控件,追加过去。
table1.open;
table1.first;//(试试看这个)
for iCount1 := 0 to table1.RecordCount - 1 do
begin
table2.Append ;
table2.FieldByName('shuliang').asinteger:=table1.FieldByName('shuliang').asinteger;
table2.Post;
table1.next;
end;
table2.open;
table1.open;
while not table1.eof do
begin
table2.Append ;
for iCount1 := 0 to table1.fieldcount-1 do
table2.Fields[i].asstring:=table1.fields[i].asstring;
table2.Post;
table1.next;
end;
问题确实出在table1.first上!!!