vb中怎么实现汉字、字母和数字组合的模糊查找

来源:百度知道 编辑:UC知道 时间:2024/04/26 13:36:01
比方,我要对车牌号“沪A123”进行模糊查找,SGL语句该怎么写呢,请高人指教......
sqlfind = "select * from [ACCESS中数据库表名] where 车牌号 like '%" & Trim(Text2.Text) & "%'"
上面是我写的但是无法查找

Private Sub Text1_Change()
sqlfind = "select * from [ACCESS中数据库表名] where 车牌号 like '" & Text2.Text & "%'"
Adodc1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\车牌管理系统.mdb;Persist Security Info=False"
Adodc1.RecordSource = sqlfind
Adodc1.Refresh
DataGrid1.Refresh
End Sub

sqlfind = "select * from [ACCESS中数据库表名] where 车牌号 like '%" & Trim(Text2.Text) & "%'" or 车牌号 like '%" & Trim(Text2.Text) & "'" or 车牌号 like '" & Trim(Text2.Text) & "%'" or 车牌号 = '" & Trim(Text2.Text) & "'"

应该是没问题的啊!~~