naturalmente da personalizzare:
codice:
' Configura SQL
	sql = "SELECT * FROM [URLIndex] WHERE"
    


	' Crca nel campo descrizione
	sql = sql & " ( [Description] LIKE '%" & QueryWords( 0 ) & "%'"			' First
	For i = LBound( QueryWords ) + 1 to UBound( QueryWords )
		If QueryWords( i ) <> "" and UCase( QueryWords(i) ) <> "OR" and UCase( QueryWords(i) ) <> "AND" Then
			If uCase( QueryWords( i-1 ) ) = "OR" Then
				sql = sql & " OR [Description] LIKE '%" & QueryWords( i ) & "%'"
			Else
				sql = sql & " AND [Description] LIKE '%" & QueryWords( i ) & "%'"
			End If
		End If
	Next

	' Cerca nel campo parole chiavi
	sql = sql & " ) OR ( [Keywords] LIKE '%" & QueryWords( 0 ) & "%'"
	For i = LBound( QueryWords ) + 1 to UBound( QueryWords )
		If QueryWords( i ) <> "" and UCase( QueryWords(i) ) <> "OR" and UCase( QueryWords(i) ) <> "AND" Then
			If uCase( QueryWords( i-1 ) ) = "OR" Then
				sql = sql & " OR [Keywords] LIKE '%" & QueryWords( i ) & "%'"
			Else
				sql = sql & " AND [Keywords] LIKE '%" & QueryWords( i ) & "%'"
			End If
		End If
	Next


	' Cerca tra i titoli
	sql = sql & " ) OR ( [Title] LIKE '%" & QueryWords( 0 ) & "%'"
	For i = LBound( QueryWords ) + 1 to UBound( QueryWords )
		If QueryWords( i ) <> "" and UCase( QueryWords(i) ) <> "OR" and UCase( QueryWords(i) ) <> "AND" Then
			If uCase( QueryWords( i-1 ) ) = "OR" Then
				sql = sql & " OR [Title] LIKE '%" & QueryWords( i ) & "%'"
			Else
				sql = sql & " AND [Title] LIKE '%" & QueryWords( i ) & "%'"
			End If
		End If
	Next


	' Cerca nel sommario
	sql = sql & " ) OR ( [Summary] LIKE '%" & QueryWords( 0 ) & "%'"
	For i = LBound( QueryWords ) + 1 to UBound( QueryWords )
		If QueryWords( i ) <> "" and UCase( QueryWords(i) ) <> "OR" and UCase( QueryWords(i) ) <> "AND" Then
			If uCase( QueryWords( i-1 ) ) = "OR" Then
				sql = sql & " OR [Summary] LIKE '%" & QueryWords( i ) & "%'"
			Else
				sql = sql & " AND [Summary] LIKE '%" & QueryWords( i ) & "%'"
			End If
		End If
	Next

	sql = sql & " )"