dim lLen as integer
dim strSql as string
dim I as integer
llen=ubound(arrvalue)
For i = 0 To lLen
If lLen = i Then
strSql = strSql & arrvalue(i)
Else
strSql = strSql & arrvalue(i) & ","
End If
Next
strSql = " delete form table1 where A not in(" & strSql & ")"
Dim arrValue() As String
Dim strValue As String
Dim strSql As String
ReDim Preserve arrValue(5)
arrValue(0) = "'Value0'"
arrValue(1) = "'Value1'"
arrValue(2) = "'Value2'"
arrValue(3) = "'Value3'"
arrValue(4) = "'Value4'"
strSql = "delete form table1 where "
For i = 0 To UBound(arrValue)
strSql = strSql + "A=" + arrValue(4)
If i < UBound(arrValue) Then strSql = strSql + " or "
Next i