delphi逐个读取access中的数据


本文整理自网络,侵删。

 if ADOQuery1.Recordset.RecordCount>0 then begin 
for i:=0 to ADOQuery1.Recordset.RecordCount-1 do
begin

string:=ADOQuery1.FieldByName('name').AsString;

adoquery1.Next;
end;
end;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

if ADOQuery1.Recordset.RecordCount>0 then
begin
for i:=0 to ADOQuery1.Recordset.RecordCount-1 do
begin

str1:=ADOQuery1.FieldByName('dizhic').AsString;

adotable4.Append ;
adotable4.FieldValues['wenzhang']:=str1;
adotable4.Post;

adoquery1.Next;
end;
end;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to memo1.Lines.Count-1 do
begin
adotable1.Append;
adotable1.FieldValues['gjz']:=memo1.Lines.Strings[i];
adotable1.Post;
adotable1.Next;

end;
adotable1.Active:=false;
adotable1.Active:=true;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
i:integer;
s:string;
begin
adoquery1.Active:=false;
adoquery1.Active:=true;

for i:=0 to adoquery1.Recordset.RecordCount-1 do
begin
s:=ADOQuery1.FieldByName('gjz').asstring;
memo2.Lines.Add(s);
adoquery1.Next;
end;
end;


adoquery1的 sql语句:select * from gjz

相关阅读 >>

Delphi 判断图像格式bmp jpg gif pcx png psd ras sgi tiff err

Delphi listview中加载图片

Delphi中判断某个文件是否已经打开

Delphi 10 seattle中的画布上绘制字符

解决Delphi程序在非中文系统下乱码

Delphi 如何在toolbar中的toolbutton上显示文字

Delphi 隐藏 tpagecontrol 的标签方法

Delphi 提高进程自身权限

Delphi url protocol 让浏览器运行本地的exe程序

Delphi xe2 - 点点滴滴

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...