On Thursday 16 March 2006 13:33, Michael Van Canneyt wrote:
> On Thu, 16 Mar 2006, johnf wrote:
> > Hi,
> >
> > Thanks all for the recent help. I am now able to retreive data without
> > any trouble (so far). And using a dataset allows the data aware controls
> > to display data but I can't save the edit fields (even if I tab off the
> > control). Everything I've read suggest that I need to set the
> > 'datasource1.edit:=True' and the 'readonly' property to false for
> > controls - to allow editing and saving (Update table).
>
> This should be done automatically ?
>
> > But when I attempt to save a
> > record I get no error message but I also have no record changes. My
> > postgres log has a rollback as the last statement. But I also don't see
> > an "update" statement. So I guess I'm missing a step (of course I could
> > be missing the entire concept).
> >
> > In a save button click I have the following code:
> > datasource1.dataset.UpdateRecord;
> > datasource1.dataset.Post;
>
> 1. Normally, a simple Post should be enough.
> 2. You should commit the transaction when you're completely done.
>
> Michael.
If I attempt a commit as in:
sqlquery1.sql.text:='commit';
sqlquery1.execsql;
I get a exception : (I para-phase) can't update because dataset is active.
If I
dataset.close;
then
commit
I get no error message but no update.
So to recap
datasource1.dataset.UpdateRecord;
datasource1.dataset.Post;
datasource1.DataSet.close;
sqlquery1.sql.Clear;
sqlquery1.SQL.Text:='commit';
sqlquery1.ExecSQL
sqlquery1.Close;
does not work.
BTW have no experience using any recent Delphi. All that I'm learning is
through the school of hard knocks (reading articles from google). But when I
get this working I will post to the wiki.
John
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives