Subject Re: [IBO] Hello and a question
Author Helen Borrie
At 02:18 PM 12/02/2008, you wrote:

>Thanks again Helen for your swift reply with you help the error is
>gone but like you said I now have a problem with null blob fields
>being created when my program starts and if I am understanding you
>correctly you are saying thats because I used the INSERT statement in
>the IB_DSQL component

No, that's not what I was saying.

It's fine to use the IB_DSQL component as you are doing, to perform an immediate insert to the table.

> as well as calling it again when I used the button

NO! When you use your button click routine, with my modifications, will be executed. What I'm saying is that IF you have a query from the table also on the form, perhaps displaying the output in a Control Grid or some other control (or even just a flat, one-record layout) then the IB_Query component underlying that may be editable. (It would be, if you used my demo as your starting point.)

TIB_Query is a TIB_Dataset descendant and, as such, has its own built-in Insert, Update and Delete behaviours. So - if you either clicked on the Insert button of a co-attached TIB_UpdateBar or you navigated past the end of this "live" dataset, then the dataset would be in Insert mode and would create a new record. The GeneratorLinks would cause the Gen_ID() function to be called and fetch a generator value from the database. If Post was then callled, the new record would be posted with a null Blob. (Null is NOT "blank" !!)

>so it will get created 2 times (first when the program loads
>making the null blob filed) and then again when I call it via the
>button click. If I am understandin you correctly

No, you're not.

>then I understand why
>you said I must do away with one or the other of them but thats where
>I am lost again and don't really know where at in my code I need to
>make this change

I think that possibly, once you understand the behaviour of an editable dataset (compared with an ad hoc, unrelated DML execution via an IB_DSQL) you will see why what you're doing now is trying to ride the same horse from the sulky and the saddle simultaneously.

> and since you said you cannot see the workflow of the
>program I have included a copy of it so you can look over it and see
>what I am trying to accomplish and how I might be able to fix my
>mistakes.
>
>You can download a zipped version of the program and database from
>here.
>http://slakers.net/filehost/download.php?file=1008ab6fc9f1064986acff3278e441bf

OK, I'll take a look at it and possibly post a new demo into the files area from it. Or it might just be simpler to make a second version of the original demo that works for both reading in new images from a file and writing out existing ones to a new file.

>I hope this helps both of use understand what each other is trying to
>say

I understand what you're trying to *do* and I hope you can understand what I'm trying to *say*. ;-)

>and once again I thank you for your time and trouble I am sure
>there are far better things you would like to do with your time

Well, you just need to be a bit patient, as I have a job to do ( = "pays the rent") besides helping you out with your hobby. :-)

Meanwhile, someone else might help you out with some excerpt code that they use. (There is more than one way to kill this cat....)

Helen