1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| Dim ma_chaine As String
Dim texte_saisi As String
texte_saisi = Me.TextBoxListes.Text
If Not texte_saisi = "" Then
ma_chaine = Replace(texte_saisi, "'", "''")
If HttpContext.Current.Application("typeBD") = "SQLSERVER" Then
'ResultatListe = ReqListe.GetValeursAsReader("SELECT DISTINCT DESCRIPTION, ID_LISTEC FROM liste_commune lc, items_liste_commune ilc WHERE TYPE=1 And (CHARINDEX('" + rech_min + "', Lower(LB_ITM))>0 or CHARINDEX('" + rech_max + "', Upper(LB_ITM))>0 or CHARINDEX('" + rech_min + "', Lower(LB_ITM))>0 or CHARINDEX('" + rech_max + "', Upper(LB_ITM))>0) And lc.ID_LISTEC = ilc.LISTEC_ID_LISTEC AND SUPPRIME IS NULL ORDER BY DESCRIPTION")
ElseIf HttpContext.Current.Application("typeBD") = "ACCESS" Then
ResultatListe = ReqListe.GetValeursAsReader("SELECT DISTINCT DESCRIPTION, ID_LISTEC FROM liste_commune lc, items_liste_commune ilc WHERE TYPE=1 And (instr(LB_ITM, '" + ma_chaine + "')>0 or instr(DESCRIPTION, '" + ma_chaine + "')>0) And lc.ID_LISTEC = ilc.LISTEC_ID_LISTEC ORDER BY DESCRIPTION")
ElseIf HttpContext.Current.Application("typeBD") = "ORACLE" Then
ResultatListe = ReqListe.GetValeursAsReader("SELECT DISTINCT DESCRIPTION, ID_LISTEC FROM liste_commune lc, items_liste_commune ilc WHERE TYPE=1 And (instr(Lower(LB_ITM), || 'ma_chaine.ToLower' || )>0 or instr(Lower(DESCRIPTION), || 'ma_chaine.ToLower' || )>0) And lc.ID_LISTEC = ilc.LISTEC_ID_LISTEC ORDER BY DESCRIPTION")
End If
...
End If |
Partager