Hello,

I execute the following query :

UPDATE photo SET photo1 = LOAD_FILE("C:\\Documents and Settings\\v-cyrild\\My Documents\\My Received Files\\With my nephew.jpg") WHERE cle_modele = 4 AND cle_carrosserie = 2

It works perfectly directly on the database BUT not at all when I execute the save query through a VB ADO DB object as follows :

Set cnn = New ADODB.Connection
cnn.Open connexion
table = "photo"

' Open table ODBC linked
Set rstTable = New ADODB.Recordset
rstTable.CursorType = adOpenKeyset
rstTable.LockType = adLockOptimistic
rstTable.Open table, cnn, , , adCmdTable

Indextmp1 = ListeModele.ListIndex
Intextmp2 = ListeCarrosserie.ListIndex
Modele = ListeModele.Column(0, Indextmp1)
Carrosserie = ListeCarrosserie.Column(0, Indextmp2)


SqlQuery = "INSERT INTO " & table & " (cle_modele,cle_carrosserie) VALUES (" & Modele & "," & Carrosserie & ")"
Debug.Print SqlQuery
Set rstTable = cnn.Execute(SqlQuery)

If Photo1.ImageHeight > 0 Then
SqlQueryTmp = "UPDATE " & table & " SET photo1 = LOAD_FILE(""" & Photo1.Picture & """) WHERE cle_modele = " & Modele & " AND cle_carrosserie = " & Carrosserie
Debug.Print SqlQueryTmp
SqlQuery = Replace(SqlQueryTmp, "\", "\\")
Debug.Print SqlQuery
cnn.Execute (SqlQuery)
End If
End If
End If

Any Idea why ??

BTW, Does it exist any LOAD_FILE equivalent for files located on the user's workstation ??

Thanks for your help,

Cyril