delphi代码如下:
procedure TForm1.Edit1Change(Sender: TObject);
begin
ADOQuery1.SQL.Text:='SELECT * FROM tstuinfo WHERE xuehao like '+QuotedStr(Edit1.Text)+'%';
ADOQuery1.Open;
if ADOQuery1.IsEmpty then
begin
ShowMessage('没有找到');
Exit;
end;
ListBox1.Clear;
while not ADOQuery1.Eof do
begin
ListBox1.Items.Add(ADOQuery1.FieldByName('xuehao').AsString);
ADOQuery1.Next;
end;
end;
procedure TForm1.Edit1Change(Sender: TObject);
begin
ADOQuery1.SQL.Text:='SELECT * FROM tstuinfo WHERE xuehao like '+QuotedStr(Edit1.Text)+'%';
ADOQuery1.Open;
if ADOQuery1.IsEmpty then
begin
ShowMessage('没有找到');
Exit;
end;
ListBox1.Clear;
while not ADOQuery1.Eof do
begin
ListBox1.Items.Add(ADOQuery1.FieldByName('xuehao').AsString);
ADOQuery1.Next;
end;
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货