mysql lazarus tutorial lazarus / 16-Databases ---------------------------------------------------------------------- jacem · 2013-06-04 20:51 I'm attempting the mysql lazarus tutorial at http://wiki.freepascal.org/mysql when I try to Run -> build the code Code: [Select] procedure TTryMysql.ConnectButtonClick(Sender: TObject); begin   // check if we have an active connection If so Let's close it   if MySQL51Connection1.Connected then CloseConnection(Sender);   // set the connection parameters   MySQL51Connection1.HostName := HostEdit.Text;   MySQL51Connection1.UserName := UserEdit.Text;   MySql51connection1.Password := PasswdEdit.Text;   MySQL51Connection1.DatabaseName := 'media';   ShowString('Opening a connection to Server: ' + HostEdit.Text);   MySQL51Connection1.Open;   // first Lets get a list of the Avalible databases   if MySQL51Connection1.Connected then begin     ShowString('Connected to Server: ' + HostEdit.Text);     ShowString('Retieving list of available database.');     SQLQuery1.SQL.Text := 'show databases';     SQLQuery1.Open;     while not SQLQuery1.EOF do begin       DatabaseCombo.Items.Add(SQLQuery1.Fields[0].AsString);       SQLQuery1.Next;     end;     SQLQuery1.Close;     ShowString('List of database received!');   end; end;                I get these errors Code: [Select] unit1.pas(58,55) Error: Identifier not found "CloseConnection" unit1.pas(64,13) Error: Identifier not found "ShowString" unit1.pas(68,15) Error: Identifier not found "ShowString" unit1.pas(69,15) Error: Identifier not found "ShowString" unit1.pas(77,15) Error: Identifier not found "ShowString" unit1.pas(86) Fatal: There were 5 errors compiling module, stopping where do I find the reference to the CloseConnection and ShowString identifiers TIA JACEM ---------------------------------------------------------------------- ludob · 2013-06-05 06:43 The link to the sources is not valid anymore. It is now http://sourceforge.net/projects/lazarus-ccr/files/Demos%20and%20exampl es/MySql%20demo%20using%20SQLdb%20components%208%20April%202005/mysql_ demo_20050408.tar.gz/download. I updated the link on the wiki page. ---------------------------------------------------------------------- jacem · 2013-06-05 20:25 This version refuses to load Quote Unable to find the component class "TMySQLConnection". It is not registered via RegisterClass and no LFM Wsa Found. It is needed by unit: F:\jon\bin\lazarus\mysql_demo_20050408\utrymysql.pas The problem is probably that the TMySQLConnection had it's name changed from TMySQL??Connection  ?? == the version of the MySQL server. Is there any way to edit the files by hand so it matches one of the MySQL Connector version in my system? Also where are the ShowString and the CloseConnection identifiers so that I can add them and compile the code. TIA j ---------------------------------------------------------------------- jacem · 2013-06-08 22:06 Hey the downloaded code doesn't actually load, and when I enter the code from the tutorial Code: [Select] procedure TTryMysql.ConnectButtonClick(Sender: TObject); begin   // check if we have an active connection If so Let's close it   if MySQL51Connection1.Connected then CloseConnection(Sender);   // set the connection parameters   MySQL51Connection1.HostName := HostEdit.Text;   MySQL51Connection1.UserName := UserEdit.Text;   MySql51connection1.Password := PasswdEdit.Text;   MySQL51Connection1.DatabaseName := 'media';   ShowString('Opening a connection to Server: ' + HostEdit.Text);   MySQL51Connection1.Open;   // first Lets get a list of the Avalible databases   if MySQL51Connection1.Connected then begin     ShowString('Connected to Server: ' + HostEdit.Text);     ShowString('Retieving list of available database.');     SQLQuery1.SQL.Text := 'show databases';     SQLQuery1.Open;     while not SQLQuery1.EOF do begin       DatabaseCombo.Items.Add(SQLQuery1.Fields[0].AsString);       SQLQuery1.Next;     end;     SQLQuery1.Close;     ShowString('List of database received!');   end; end;                I still get the following errors Quote unit1.pas(58,55) Error: Identifier not found "CloseConnection" unit1.pas(64,13) Error: Identifier not found "ShowString" unit1.pas(68,15) Error: Identifier not found "ShowString" unit1.pas(69,15) Error: Identifier not found "ShowString" unit1.pas(77,15) Error: Identifier not found "ShowString" unit1.pas(86) Fatal: There were 5 errors compiling module, stopping where do I find the references to identify CloseConnection and ShowString TIA j ---------------------------------------------------------------------- ludob · 2013-06-10 04:45 Quote from: jacem on June 09, 2013, 12:06:15 amwhere do I find the references to identify CloseConnection and ShowString They are in the unit utrymysql.pas, included in the tar.gz file the link points to.