Lazarus

Programming => Databases => Topic started by: panjas51 on February 08, 2008, 11:45:08 pm

Title: Tdbgrid update SQL with Mysql5
Post by: panjas51 on February 08, 2008, 11:45:08 pm
Bonjour à tous;
Hello everybody;

I'm looking for a way to update my SQL table (Mysql5.0) within a TDBgrid.

The TDBgrid works fine with these parameters only

Code: [Select]
SQLQuery1.ParseSQL:=false; SQLQuery1.ReadOnly:=true;
SQLQuery1.SQL.Text := 'select * from FPdev'+#0;
SQLQuery1.Open;


Thus, during an update, I get an error message like: Impossible, Read only.

If I try with:
Code: [Select]
SQLQuery1.ParseSQL:=true; SQLQuery1.ReadOnly:=false;

"Project raised exception class 'EDatabaseError' with message: Transaction of connection not set"


Thanks for your help

Lazarus 0.9.24
Linux Ubuntu
phpMyAdmin 2.8.1

   
Code: [Select]
   Datasource1: TDatasource;
    DBGrid1: TDBGrid;
    MySQL50Connection1: TMySQL50Connection;
    SQLQuery1: TSQLQuery;
    SQLTransaction1: TSQLTransaction;
Title: RE: Tdbgrid update SQL with Mysql5
Post by: panjas51 on February 09, 2008, 11:01:12 am
Bravo !!!!!

Thanks a lot


Quote from: "jzombi"


I've modified your program, so you can now change the data, and you can add new fields to a table too.
You can download it from here:
http://digitus.itk.ppke.hu/~janma/lazarus/MySql5Test.tar.gz
I hope, you'll find it useful.

Regards.
ps. sorry, my english is very bad after midnight:)
TinyPortal © 2005-2018