7,785
社区成员




以access为例:
[code=SQL]
Dim sql As String
Dim i As Integer
sql = "select * from tb where len(zuzhif)=" & Len(Trim(Text1))
For i = 1 To Len(Trim(Text1))
sql = sql & " and instr(zuzhif,'" & Mid(Trim(Text1), i, 1) & "' )"
Next
'Debug.Print sql
Adodc1.RecordSource =sql
[/code]
Dim sql As String
Dim i As Integer
sql = "select * from tb where len(zuzhif)=" & Len(Trim(Text1))
For i = 1 To Len(Trim(Text1))
sql = sql & " and instr(zuzhif,'" & Mid(Trim(Text1), i, 1) & "' )"
Next
'Debug.Print sql
Adodc1.RecordSource =sql