On 10/9/06, Joost van der Sluis <[EMAIL PROTECTED]> wrote:
On Mon, 2006-10-09 at 14:05 +0300, Adrian Maier wrote:
> I have a form that includes: a TdbGrid and a TdbNavigator. I want to
> use the same
> form to acces any of three different tables, by specifying one sql
> query or another.
> - deleting rows doesn't work for any of the tables. The user is asked
> to confirm, but
> the row is not deleted.
> - updating works , for the tables that have a simple primary key
> - for the table that has a 3-column primary key, i have been able to
> specify a custom
> sql command . The update reaches the database, but the transaction
> is no longer
> committed. The same "save" button commits the data for the other
> tables, though.
Are you sure all queries has the same transaction?
Yes, I think.
It's only one form. In the OnActivate event handler, there is a 'case' where I
set the sql query according to a parameter. So, the bahaviour is supposed
to be the same for the three different tables.
> I'm not sure whether the problem is only my lack of knowledge, or the
> support for
> PostgreSQL is simply not mature enough.
I would guess it's both.
The problem that you encountered so far, weren't postgres-related. So
switching to fb won't help much.
Switching isn't an option anyway. In fact i am porting an older
application, and
I have no plan to reimplement all the reports so that they work with another
databases.
> c. What is the approach that I should follow : should I consider
> dealing with the database
> manually? Simply associating a TdbGrid with a TsqlQuery is far from
> working out-of-the-box
> (at least with sqldb and postgres) .
Just submit bug-reports. There are so many things you can do with the
database-utils, it's impossible to check them all. For some it will work
out-of-the-box, for others it oculd be somewhat more difficult.
I see.
Multiple-fields-primary keys, for example, I consider as a bad design.
(I can imagine some exceptions, but those are really rare) Must db-
programmers won't use them, so for them it works 'out-of-the-box'...
Well, this case is rare indeed : I have only one such table. But it's an
important one and it makes sense to have a 3-column primary key. This
issue is now solvable, but i haven't decided yet exactly how ( i could either
specify the queries manually , or use a surrogate key ).
The current big problem is that deleting rows doesn't work. After confirmation,
the grid flickers a litlle (the data is re-read i think) and the row
is still there !
There is no DELETE sent to the database .
Any ideas? how is the deletion supposed to work?
Just submit bug reports if you found them, and ask here for help. That's
probably the best you can do, and the best for fpc/lazarus.
Yes, I know that.
I am currently in a quiet period at work and have plenty of time to experiment.
The bad thing is that I have the feeling that the progress is too slow . And my
messages seem to show up on the list after many hours, therefore I can try the
advices only the second day.
Cheers,
Adrian Maier
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives