<%
Dim strSQL As String
strSQL = "SELECT * FROM table WHERE 1 "
IF strCon1 <> "" Then
strSQL = strSQL & " AND F1 = 'Va1' "
End IF
IF strCon2 <> "" Then
strSQL = strSQL & " AND F2 = 'Va2' "
End IF
IF strCon3 <> "" Then
strSQL = strSQL & " AND F3 = 'Va3' "
End IF
%>