sql2000中,表中明明有记录,却在Delphi中查不到(50分)

  • 主题发起人 lanchong
  • 开始时间
L

lanchong

Unregistered / Unconfirmed
GUEST, unregistred user!
Delphi5+MS SQL Server2000中如下一段代码:
procedure TForm1.ComboBox1DropDown(Sender: TObject);
begin
combobox1.clear;
with adotable1 do
begin
open;
while not eof do
begin
combobox1.Items.Add(adotable1.fieldbyname('name').asstring);
next;
end;
close;
end;
end;
运行后,总是提示错误:BOF或EOF有一个是真,或者当前的记录已被删除,所需的操作
要求一个当前的记录。
但是,在SQL查询器中,表里确实有数据啊。各位大侠救救我。
 
open;
First;
你再测试一下
 
还是老问题,这是ado的bug,装补丁吧,
不装也行,在close前first,不过最好还是装
ftp://ftpc.inprise.com/pub/delphi/devsupport/updates/adoexpress/d5adoupdate2.exe
不过要先装d5的pack1
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
顶部