Subject | Re: [IBO] TIBOQuery posting error |
---|---|
Author | Robert martin |
Post date | 2005-07-05T21:55:46Z |
Hi
Use ExecSQL instead of open. Open is for select type statements that
return data. Not sure why the query would be in insert mode, unless you
have an insert query setup in the component, in which case you should
justed load the fields (fieldbyname('sdfd').AsString := ..... and then
post.
Hope this helps
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Nols Smit wrote:
Use ExecSQL instead of open. Open is for select type statements that
return data. Not sure why the query would be in insert mode, unless you
have an insert query setup in the component, in which case you should
justed load the fields (fieldbyname('sdfd').AsString := ..... and then
post.
Hope this helps
Rob Martin
Software Engineer
phone +64 03 377 0495
fax +64 03 377 0496
web www.chreos.com
Wild Software Ltd
Nols Smit wrote:
>I'm using the code appearing below to update a FireBird table via an IntraWeb application:
>
> if UserSession.IBOPhotoAlbum.State = dsInsert then
> begin
> with UserSession.IBOPhotoAlbum do
> begin
> Close;
> SQL.Clear;
> SQL.Add('Insert into PhotoAlbum (Description, LoadedPhoto)');
> SQL.Add('Values (:Description, :LoadedPhoto)');
> ParamByName('Description').AsString := edtDescription.text;
> ParamByName('LoadedPhoto').LoadFromStream (UserSession.ms, ftGraphic);
> Open;
> end;
> end;
>
>But on executing the Open statement, I get the following error message although the record is loaded.
>
>class EIB_Error with message 'FieldNo: -1 not found'.
>
>The table has a unique key named ID. I increment this key via the following trigger code:
>
>AS
>BEGIN
> IF (NEW.ID is null) THEN
> NEW.ID = GEN_ID(photoalbum_id_gen, 1);
>END
>
>Apart from the error message, the updating seems fine.
>
>
>
>Regards,
>
>Nols Smit
>
>
>[Non-text portions of this message have been removed]
>
>
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
>http://www.ibobjects.com - your IBO community resource for Tech Info papers,
>keyword-searchable FAQ, community code contributions and more !
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>