>Ciao ho questo codice
>
>If Not IsNull(strTxtRc) Or Trim(strTxtRc) = "" Then
>strWhere = "Where Tbl_Artista.ArtDescrizione Like '*" & Trim(strTxtRc)
>& "*'"
> strOrderBy = "ORDER BY Tbl_Cd.Artista, Tbl_Cd.Titolo"
>Else
> strWhere = ""
> strOrderBy = ""
>End If
>
>e vorrei aggiungere il comando Where Tbl_Artista not like "test*"
>ma scritto così non funziona MI potreste aiutare?
Probabilmente è sbagliata la condizione di test su stringa nulla.
Modifica la riga
If Not IsNull(strTxtRc) Or Trim(strTxtRc) = "" Then
come
If Not IsNull(strTxtRc) Or Trim(strTxtRc) <> "" Then
Ad ogni modo tieni presente che quel codice è molto pericoloso in quanto permette attacchi di tipo SQL Injection:
http://www.dotnethell.it/articles/SQL-Injection-Tutorial-Security.aspx
>Grazie
Prego.
Ciao!
--
Lorenzo Benaglia
Microsoft MVP - SQL Server
http://blogs.dotnethell.it/lorenzo/