早说嘛,这里我假设你不限定的部分为空啊
那么
dim a as string ,b as string ,c as string,d as string
Dim strSQL As String
If a = "" Then
a = "_"
End If
If b = "" Then
b = "_"
End If
If c = "" Then
c = "_"
End If
If d = "" Then
d = "_"
End If
strSQL = "select * from table where 字段='" & a & "-" & b & "-" & c & "-" & d & "'"
rst.open strSQL,cnn,...