用locate是不能查找下一条记录的,你可以试试LocateNext
解决方案 »
- 关于sql server时间格式
- 检验是否打印问题??!!详细请进来看 ,在线等。。。。
- 哪位大哥可以提供能使现有程序界面能变成XP风格的控件,谢谢?
- 大家帮帮我这个菜鸟吧(数据库入门)
- 程序启动窗体出现的问题,导致系统主窗体最小化时不能到任务栏,只能到桌面左下角的问题,帮忙看一下代码!!
- 为什么在调用我自己做的dll函数时,传入的参数会改变?
- 请教几个基本常识
- 请问使用ADO连接.在添加记录前进行判断为什么没有效果那...(102分我的最高分了)
- delphi6 和5有很大不同么????
- (江湖救急)dbgrid中Password字段的显示问题。
- 万用查询!!!
- 如何让DBGRID中的内容分页显示
var iPos:integer;
KeyValue:variant;
begin
result:=false;
iPos:=clientdataset1.RecNo;
KeyValue:=clientdataset1.FieldValues['keyfield'];
while iPos<clientdataset1.recordcount do
begin
inc(iPos);
clientdataset1.RecNo:=iPos;
if KeyValue=clientdataset1.FieldValues['keyfield'] then
begin
result:=true;
break;
end;
end;
end;
Query1.next;
上一条
Query1.prior;还有
FindFirst, FindNext, FindCloseThe following example uses an edit control, a button, a string grid, and seven check boxes. The check boxes correspond to the seven possible file attributes. When the button is clicked, the path specified in the edit control is searched for files matching the checked file attributes. The names and sizes of the matching files are inserted into the string grid.
procedure TForm1.Button1Click(Sender: TObject);var
sr: TSearchRec;
FileAttrs: Integer;
begin
StringGrid1.RowCount := 1;
if CheckBox1.Checked then
FileAttrs := faReadOnly
else
FileAttrs := 0;
if CheckBox2.Checked then
FileAttrs := FileAttrs + faHidden;
if CheckBox3.Checked then
FileAttrs := FileAttrs + faSysFile;
if CheckBox4.Checked then
FileAttrs := FileAttrs + faVolumeID;
if CheckBox5.Checked then FileAttrs := FileAttrs + faDirectory;
if CheckBox6.Checked then
FileAttrs := FileAttrs + faArchive;
if CheckBox7.Checked then FileAttrs := FileAttrs + faAnyFile; with StringGrid1 do
begin
RowCount := 0; if FindFirst(Edit1.Text, FileAttrs, sr) = 0 then begin
repeat
if (sr.Attr and FileAttrs) = sr.Attr then
begin
RowCount := RowCount + 1;
Cells[1,RowCount-1] := sr.Name;
Cells[2,RowCount-1] := IntToStr(sr.Size);
end;
until FindNext(sr) <> 0;
FindClose(sr);
end;
end;
end;