Bonjour à tous
Mon pb aujourd'hui : je fais une requete qui remonte des données vers une base oracle. mais il me manque des guillemets mais je ne sais pas ou.
Dim myConn
Dim myCommand
Set myConn = CreateObject("ADODB.Connection")
Set myCommand = CreateObject("ADODB.Command")
myConn.Open = "Provider=MSDAORA.1;Password=toto;User ID=titi;Data Source=toto.fr;Persist Security Info=True"
For i = 20 To 2000
If Sheets("texte").Rows(i).Cells(3) = "gb" Then Exit For
strSQL = "UPDATE ITEM SET VAL_ITEM04 = 1
WHERE '" & Sheets("DEVIS").Rows(i).Cells(3) & "' = TXT_FREEZONE
and '" & Sheets("DEVIS").Rows(i).Cells(7) & "' <> "" "
Set myCommand.ActiveConnection = myConn
myCommand.CommandText = strSQL
Set oRs = myCommand.Execute
Next i
myConn.Close
Merci pour votre aide
Mon pb aujourd'hui : je fais une requete qui remonte des données vers une base oracle. mais il me manque des guillemets mais je ne sais pas ou.
Dim myConn
Dim myCommand
Set myConn = CreateObject("ADODB.Connection")
Set myCommand = CreateObject("ADODB.Command")
myConn.Open = "Provider=MSDAORA.1;Password=toto;User ID=titi;Data Source=toto.fr;Persist Security Info=True"
For i = 20 To 2000
If Sheets("texte").Rows(i).Cells(3) = "gb" Then Exit For
strSQL = "UPDATE ITEM SET VAL_ITEM04 = 1
WHERE '" & Sheets("DEVIS").Rows(i).Cells(3) & "' = TXT_FREEZONE
and '" & Sheets("DEVIS").Rows(i).Cells(7) & "' <> "" "
Set myCommand.ActiveConnection = myConn
myCommand.CommandText = strSQL
Set oRs = myCommand.Execute
Next i
myConn.Close
Merci pour votre aide
Dernière édition: