我想到办法了,如下:
adoquery1.SQL.Add('select * from bb3 where '+
' HaoMa='''+inttostr(b)+inttostr(s)+inttostr(g)+''''+
' or HaoMa='''+inttostr(b)+inttostr(g)+inttostr(s)+''''+
' or HaoMa='''+inttostr(s)+inttostr(b)+inttostr(g)+''''+
' or HaoMa='''+inttostr(s)+inttostr(g)+inttostr(b)+''''+
' or HaoMa='''+inttostr(g)+inttostr(s)+inttostr(b)+''''+
' or HaoMa='''+inttostr(g)+inttostr(b)+inttostr(s)+'''');
我的是Access数据库,不知道能不能用楼上采用定义变量的方法,我试了一下不行,