All pastes #507541 Raw Edit

Stuff

public text v1 · immutable
·published 2007-05-24 16:57 UTC
rendered paste body
Dim Ls_Phrase, Ls_Phrase_Envers, ls_temp As String
Dim Li_compteur As Integer
Dim ls_Sql As String
Dim rst As New ADODB.Recordset
Dim Cnn_connection As ADODB.Connection

Set Cnn_connection = Application.CurrentProject.Connection

If txt_source.Value = "" Or IsNull(txt_source.Value) Then Exit Sub
Ls_Phrase = txt_source.Value

For Li_compteur = Len(Ls_Phrase) To 1 Step -1
    ls_Sql = "SELECT * FROM [legende] WHERE [source] = '" & F_String_For_SQL(Mid(Ls_Phrase, Li_compteur, 1)) & "'"
    rst.Open ls_Sql, Cnn_connection, adOpenDynamic, adLockOptimistic
    If Not rst.EOF Then
         Ls_Phrase_Envers = Ls_Phrase_Envers & rst![traduction]
    Else
        Ls_Phrase_Envers = Ls_Phrase_Envers & Mid(Ls_Phrase, Li_compteur, 1)
    End If
    rst.Close
Next
Txt_Reponse.Value = Ls_Phrase_Envers