J
jimyho
Unregistered / Unconfirmed
GUEST, unregistred user!
我看过以前的记录,几乎没有用SQL来解决问题.
我用:
sFileName:='c:/abc.gif';
adoCommand1.CommandText:=
'insert into Images(FileName,Image) values ('
+ ':FileName,:Image)';
adoCommand1.Parameters.ParamByName('FileName').DataType:= ftString;
adoCommand1.Parameters.ParamByName('FileName').Value:= sFileName;
adoCommand1.Parameters.ParamByName('Image').LoadFromFile(sFileName,ftBlob{ftGraphic});
adoCommand1.Execute; //--报错 'Syntax error in INSERT INTO Statement'
不加Image,一切 OK,不知何解???????
adoCommand1.CommandText:=
'insert into Images(FileName) values ('
+ ':FileName)';
adoCommand1.Parameters.ParamByName('FileName').DataType:= ftString;
adoCommand1.Parameters.ParamByName('FileName').Value:= sFileName;
adoCommand1.Execute; //--OK
我用:
sFileName:='c:/abc.gif';
adoCommand1.CommandText:=
'insert into Images(FileName,Image) values ('
+ ':FileName,:Image)';
adoCommand1.Parameters.ParamByName('FileName').DataType:= ftString;
adoCommand1.Parameters.ParamByName('FileName').Value:= sFileName;
adoCommand1.Parameters.ParamByName('Image').LoadFromFile(sFileName,ftBlob{ftGraphic});
adoCommand1.Execute; //--报错 'Syntax error in INSERT INTO Statement'
不加Image,一切 OK,不知何解???????
adoCommand1.CommandText:=
'insert into Images(FileName) values ('
+ ':FileName)';
adoCommand1.Parameters.ParamByName('FileName').DataType:= ftString;
adoCommand1.Parameters.ParamByName('FileName').Value:= sFileName;
adoCommand1.Execute; //--OK