一个简单的问题???? 用Table过滤数据,在线等待!!!

brilliant83 2003-05-05 03:47:39

如何用Table过滤数据,比如过滤出Id='3'的记录,并用ComboBox列出相关字段的值??
...全文
24 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
brilliant83 2003-05-06
  • 打赏
  • 举报
回复
多谢各位,问题已经解决了
jiezhi 2003-05-05
  • 打赏
  • 举报
回复
还可以使用OnFilterRecord事件来写。
AaronChengBJ 2003-05-05
  • 打赏
  • 举报
回复
var temp:string;
i:integer;

temp:='3'
table.filter:='id='''+temp+'''';
table.filtered:=true;
combobox1.items.clear;
for i:=0 to table.recordcount-1 do
begin
if combobox.items.indexof(table.fielbyname('myfield').asstring)=-1 then
combobox.items.add(table.fieldbyname('myfield').asstring);
table.next;
end;
WWWWA 2003-05-05
  • 打赏
  • 举报
回复
table1.Close;
z:='id=3';
table1.Filtered:=false;
table1.Filter:=z;
table1.Open;
table1.Filtered:=true;

2,507

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 数据库相关
社区管理员
  • 数据库相关社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧