模糊查询
程序代码:
Public cn As New ADODB.Connection Public rs As New ADODB.Recordset Sub mysql() cn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=123456;Data Source=" & App.Path & "\FData.mdb" End Sub Private Sub Command1_Click() List1.Clear Call mysql rs.Open "select * from [FileData] Where FileNamemy Like '" & Text1.Text & "%'", cn, 1, adLockReadOnly Label1.Caption = rs.RecordCount Do Until rs.EOF = True List1.AddItem rs.Fields("FileNamemy") rs.MoveNext Loop cn.Close End Sub
模糊查询,看看哪里错了,换用"*"通配符不行
MDB附件已上传
FData.rar
(14.53 KB)