首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

如何实现模糊查询

2012-01-11 
怎么实现模糊查询Private Sub kscx_Click()If Len(Text1.Text) 0 ThenAdodc1.CommandType adCmdTextAd

怎么实现模糊查询
Private Sub kscx_Click()
If Len(Text1.Text) > 0 Then
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = "select * from fuzhuzhuangzhi where gzxx='" & Trim(Text1.Text) & " ' "
Adodc1.Refresh
Else
End If
End Sub

[解决办法]
Adodc1.RecordSource = "select * from fuzhuzhuangzhi where gzxx like '%" & Trim(Text1.Text) & "%'"

[解决办法]
% 只是通配符之一,你还可以查下,还有很多其他通配符的 比如 _ ?
[解决办法]
模糊查询就得用like

热点排行