Mysql components problems lazarus / 16-Databases ---------------------------------------------------------------------- rob.verhoef · 2008-07-02 10:28 Hello, New to Lazarus but with experience using Mysql in Delphi applications. I started with a TMySQL50Connection on my mainform (New Project started). When i try to create a method for the AfterConnect event (click on the ... button in the events section of the TMySQL50Connection) i get a "Unable to create new method. Please fix the error shown in the message window". When i look at the Messages window no error appears. I've tried this both on windows and linux with the same result. This error persists even if all the properties are filled out and it also seems that it connects to the database server. Still when i try to add a query and transaction and hook them together the SQLTransaction and the SQLQuery i am not able to set the active property to true on both these components. I've tried installing, reinstalling, v0.9.24 and 0.9.25 on windows and linux (Suse 10.2) but without success. Anyone who can help?? The "events" problem is only with the SQL components Regards, Rob ---------------------------------------------------------------------- Legolas · 2008-07-03 12:38 Same error here: I use sqlite3connection and, in this case, no error pops up, just nothing happens. If I try to add the event handler by hand, it is removed when I try to compile the project. Seems that all connection components in the sqldb package have this behaviour. ---------------------------------------------------------------------- DrMac · 2008-07-04 18:43 What is the version of your Free Pascal compiler? ---------------------------------------------------------------------- wmcdona89 · 2008-07-04 21:34 I'm having the same problem with fpc-2.2.0 and fpc-2.2.2rc1 on both Windows and Linux. ---------------------------------------------------------------------- wmcdona89 · 2008-07-04 22:27 The following sample program never populates DBGrid1 which is associated with Datasource1. unit Unit1; {$mode objfpc}{$H+} interface uses   Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,   mysql50conn, db, DbCtrls, DBGrids, sqldb, ComCtrls, StdCtrls;   type   { TForm1 }   TForm1 = class(TForm)     MySQL50Connection1: TMySQL50Connection;     SQLTransaction1: TSQLTransaction;     SQLQuery1: TSQLQuery;     Datasource1: TDatasource;     DBGrid1: TDBGrid;     Select: TButton;     procedure SelectClick(Sender: TObject);   private     { private declarations }   public     { public declarations }   end; var   Form1: TForm1; implementation     { TForm1 }     procedure TForm1.SelectClick(Sender: TObject);     begin          MySQL50Connection1.Connected:=false;          MySQL50Connection1.HostName:='localhost';          MySQL50Connection1.Databasename:='my_dev';          MySQL50Connection1.UserName:='root';          MySQL50Connection1.Password:='root';          MySQL50Connection1.Connected:=true;          SQLTransaction1.Database:=MySQL50Connection1;          SQLTransaction1.Active:=true;          SQLQuery1.Database:=MySQL50Connection1;                SQLQuery1.Transaction:=SQLTransaction1;          SQLQuery1.DataSource:=Datasource1;          SQLQuery1.Active:=true;          DataSource1.DataSet:=SQLQuery1;          SQLQuery1.Close;          SQLQuery1.SQL.Clear;          SQLQuery1.SQL.Add('select * from test_table');          SQLQuery1.Open;     end; initialization   {$I unit1.lrs} end. ---------------------------------------------------------------------- jesusr · 2008-07-12 06:10 SQLQuery1.Datasource should not be set, change it to SQLQuery1.DataSource:=nil; // or not write this line at all ---------------------------------------------------------------------- irw10062 · 2008-09-04 03:00 i got this error too.. laz 0.9.24 fpc 2.2.0 win32 how to fix.. ---------------------------------------------------------------------- normanp · 2008-09-27 11:10 I have put a working example in the wiki tutorials, database tutorial section 3, 2nd prog