Board index » delphi » HELP !!! TDataBase... HELP again !! TDataBase... HELP again !! TDataBase... HELP again !!

HELP !!! TDataBase... HELP again !! TDataBase... HELP again !! TDataBase... HELP again !!

Hello !!

Sorry to insist, but I'm really locked !
I have a data base I join from delphi 2.0 by SQL server.
For the first access, I 'connect' the Database with a
  DataBase.connected := TRUE ;

Next, I want to modify data. So, I write new values in DBcontrols. That
sets the Base State value at dsEdit.
After that, I try to sart a transaction like that :
  DataBase.StartTransaction ;
It falls down with a global sql error ("erreur sql gnrale").

After various attempts, I've tried without opening a transaction. The
result have been better... For the first update, there is no problem,
the second and the third are not garanties ! The third always gives an
access violation at XXX...

Fran?ois Delaby.

 

Re:HELP !!! TDataBase... HELP again !! TDataBase... HELP again !! TDataBase... HELP again !!


Quote
Fran?ois Delaby wrote:

> Hello !!

> Sorry to insist, but I'm really locked !
> I have a data base I join from delphi 2.0 by SQL server.
> For the first access, I 'connect' the Database with a
>   DataBase.connected := TRUE ;

> Next, I want to modify data. So, I write new values in DBcontrols. That
> sets the Base State value at dsEdit.
> After that, I try to sart a transaction like that :
>   DataBase.StartTransaction ;
> It falls down with a global sql error ("erreur sql gnrale").

> After various attempts, I've tried without opening a transaction. The
> result have been better... For the first update, there is no problem,
> the second and the third are not garanties ! The third always gives an
> access violation at XXX...

> Fran?ois Delaby.

use before DataBase.StartTransaction  insert new value

Re:HELP !!! TDataBase... HELP again !! TDataBase... HELP again !! TDataBase... HELP again !!


Quote
Fran?ois Delaby wrote:

> Hello !!

> Sorry to insist, but I'm really locked !
> I have a data base I join from delphi 2.0 by SQL server.
> For the first access, I 'connect' the Database with a
>   DataBase.connected := TRUE ;

> Next, I want to modify data. So, I write new values in DBcontrols. That
> sets the Base State value at dsEdit.
> After that, I try to sart a transaction like that :
>   DataBase.StartTransaction ;
> It falls down with a global sql error ("erreur sql gnrale").

> After various attempts, I've tried without opening a transaction. The
> result have been better... For the first update, there is no problem,
> the second and the third are not garanties ! The third always gives an
> access violation at XXX...

> Fran?ois Delaby.

If you set the values in the database controls, Delphi will
automatically start a transaction, and take care of the updating of the
current record. After you have finished putting values in the controls,
move off the record and Delphi will post the changes and commit them to
the database. If you want to put more records into the database in one
go, start a transaction and Delphi will not commit the actions until you
explicitly code a commit.

I do not know why you experience the access violation. I have not had
any of that, but I am using Paradox and local Interbase files.

HTH

Menno

Re:HELP !!! TDataBase... HELP again !! TDataBase... HELP again !! TDataBase... HELP again !!


Dont forget that in D2 this code (and TUpdateSQL itself) does not
support blob fields.

Quote
Menno Holscher wrote:

> Fran?ois Delaby wrote:

> > Hello !!

> > Sorry to insist, but I'm really locked !
> > I have a data base I join from delphi 2.0 by SQL server.
> > For the first access, I 'connect' the Database with a
> >   DataBase.connected := TRUE ;

> > Next, I want to modify data. So, I write new values in DBcontrols. That
> > sets the Base State value at dsEdit.
> > After that, I try to sart a transaction like that :
> >   DataBase.StartTransaction ;
> > It falls down with a global sql error ("erreur sql gnrale").

> > After various attempts, I've tried without opening a transaction. The
> > result have been better... For the first update, there is no problem,
> > the second and the third are not garanties ! The third always gives an
> > access violation at XXX...

> > Fran?ois Delaby.

> If you set the values in the database controls, Delphi will
> automatically start a transaction, and take care of the updating of the
> current record. After you have finished putting values in the controls,
> move off the record and Delphi will post the changes and commit them to
> the database. If you want to put more records into the database in one
> go, start a transaction and Delphi will not commit the actions until you
> explicitly code a commit.

> I do not know why you experience the access violation. I have not had
> any of that, but I am using Paradox and local Interbase files.

> HTH

> Menno

Other Threads