Bonjour
j'ai le code suivant :
Ca fonctionne très bien pour l'insertion d'une nouvelle image dans la DB par contre si je veux modifier l'image j'ai une erreur sur la syntaxe SQL
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 if OpenPictureDialog.Execute then begin with dtsType do begin Active:=False; SQL.Clear; if (State in [dsInsert]) then SQL.Add('INSERT INTO t_hard(img) ' + 'Values(:myimg)') else SQL.Add('UPDATE t_hard SET t_hard_id = 1' + 'WHERE img = :myimg'); Parameters.ParamByName('myimg').LoadFromFile(OpenPictureDialog.FileName, ftBlob); ExecSql; end; end;
Pouvez-vous m'indiquer comment je peux mettre à jour mon champs ?
Partager