标题:一段程序看不懂?
取消只看楼主
№自然逻辑£
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2008-9-27
结帖率:100%
 问题点数:0 回复次数:1 
一段程序看不懂?
procedure TForm1.FormCreate(Sender: TObject);
begin
ComboBox1.Items.Clear;
  with ADOQuery1 do
   begin
     Close;
     SQL.Clear;
     SQL.Add('select * from yxdmb order by yxdm');
     Open;

     try
         First;
         while not EOF do
          begin
           ComboBox1.Items.Add(Fields[1].Asstring);
           Next;
          end;
        finally
         EnableControls;
        end;//End try
   end;  // ADOQuery1
  ComboBox1.ItemIndex := 0;
end;

procedure TForm1.BitBtn1Click(Sender: TObject);
var n:integer;
    str1:string;
begin
  n := ComboBox1.ItemIndex;
  with ADOQuery1 do
   begin
    First;
    MoveBy(n);
   end;
   str1:=ADOQuery1.Fields[0].AsString;
  with ADOQuery2 do
   begin
     Close;
     SQL.Clear;
     SQL.Add('select * from xsjbxxb where yxdm='''+str1+'''');
     Open;
   end;
end;

end.
搜索更多相关主题的帖子: procedure 
2008-11-18 12:06
№自然逻辑£
Rank: 1
等 级:新手上路
帖 子:28
专家分:0
注 册:2008-9-27
得分:0 
谢谢!!!
2008-11-25 11:24



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-244948-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.221276 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved