在DELPHI中判断是否到了表的末尾
解决方案 »
- delphi现在还有多少人在用?
- listViewFlowInfo 选择问题 大家帮忙看下
- (100分)哪位大大帮忙写个SSL登陆的示例?
- 请问在delphi里四舍五入涵数!
- 关于Grid的一个问题,神啊救救我吧
- web的dll发布问题
- 为何我的Hint反应那么慢?
- 在Socket的方式中,如果给出SERVER与CLIENT之间的数据传输要求,那么该怎么做。我就是看不懂,请大家帮助。
- 急呀!!!这段代码有问题,快帮我看看!!!!多谢了!!!!
- 在数据模块里是不是不能对其它窗体的控件操作
- Win2k 下 CodeGear2009 无法部署帮助文档
- delphi程序窗体和控件 如何适应1440x900分辨率?
比如表 ryxx(ryid,rykh)
AdoQuery1.sql.clear;
AdoQuery1.sql.add('select * from ryxx');
AdoQuery1.active:=true; if AdoQuery1.eof then
ShowMessage('已经到了表的末尾');
//到最后一条记录
sql.clear;
sql.add('select * from tablename');
first;////指向表的第一条记录
while not eof ////如果不是表的最后一行(你要的问题的答案!)
begin
.....////程序体
next;//指向下一条记录
end;
begin
.....;//程序
AdoQuery1.movenext;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
adostoredproc2.ExecProc;
AdoQuery1.active := false;
AdoQuery1.sql.clear;
AdoQuery1.sql.add('select * from ryxx');
AdoQuery1.active:=true;
//if AdoQuery1.eof then
// ShowMessage('已经到了表的末尾');
if trim(edit1.text)='' then
begin
while not(adoquery1.eof) do
begin
with adoStoredproc1 do
begin
Parameters.ParamByName('@rfkh').Value:='0000000001';
//adoquery1.FieldByName('rfkh').Value;
ExecProc;
end;
end;
end
else
begin
with adoStoredproc1 do
begin
Parameters.ParamByName('@rfkh').Value:=trim(edit1.text);
ExecProc;
end;
end;
adodataset1.Close;
adodataset1.Open;
adostoredproc2.ExecProc;end;
这段代码有什么问题,帮忙看下(怎么为空的时候程序就没反应了)
while not eof do
if TDateset.Eof then
begin
//这里写到表末的代码
end;