Page 1 of 1

Error 104 in FB when using a Blob Field

Posted: Sun 14 Mar 2010 19:17
by skippy
Hi,

I can't get a file saved in a blob field in a Firebird Database, here's the relevant code snippet:

// tblBinFILE is a TBlobField
// fn is a valid file name with complete path.

tblBin.Append;
tblBinFILENAME.AsString := fn;
tblBinTASK.AsInteger := id;
tblBinFILE.LoadFromFile(fn);
tblBin.Post;

I always get a

Dynamic SQL Error
SQL Error Code = -104
Token unknown - line 2, column 14
FILE.

I don't have any clue what's wrong :(

Can anybody help ?

TIA

Re: Error 104 in FB when using a Blob Field

Posted: Mon 15 Mar 2010 07:08
by malinsky
Hi,

I use:

TBlobField(qTemplates.FieldByName('XLS')).LoadFromFile(FileName);

('XLS' = blob field).

PMal

Posted: Mon 15 Mar 2010 08:50
by skippy
...which is pretty much the same, isn't it ?

Posted: Mon 15 Mar 2010 15:30
by Falcon
Set the TUniQuery.Options.QuoteNames property to True or change the field name from "File" to some other name please, because "file" is a reserved word in Interbase/Firebird.

Posted: Mon 15 Mar 2010 21:03
by skippy
:D

Thanks, works fine !!!