Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2003-02

Still :I need help with databases.

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jesus Reyes
to HSO: Hi all. I`m still having troubles with databases, i sow the database objects you have…

Hi, I think it would be useful to post the output of the program, right know I can't test the units you sent (tomorrow I will do it) but here is a link with a demo (MySQL Querier) using the same concept. http://mx.geocities.com/jesusrmx

Regards.

Jesus Reyes.

Earlier message 23 lines
----- Original Message ----- From: HSO To: Lista Lazarus Sent: Wednesday, February 19, 2003 9:45 PM Subject: [lazarus] Still :I need help with databases. > Hi all. > I`m still having troubles with databases, i sow the database objects you have send before in the list, but i don`t know how to compile then(well therefore i asked for components like delphi , actualy i don`t like then i prefer doing things like i do in c++ wich means using the mysql unit from freepascal). > So i wrote a small pascal prg accessing a mysql database , it worked fine,so i copied it into a lazarus unit(the callback off a button) i tryed to run this.The program display the correct result and then stop misteriusly. > gdb does not work, so i got completely lost, can you help me? > I`m sending the two codes(the unit from lazarus and the pas prg). _________________________________________________________ Do You Yahoo!? La mejor conexi�n a internet y 25MB extra a tu correo por $100 al mes. http://net.yahoo.com.mx

Reply by email

HSO

Hi all.
I`m still having troubles with databases, i sow the database objects you have send before in the list, but i don`t know how to compile then(well therefore i asked for components like delphi , actualy i don`t like then i prefer doing things like i do in c++ wich means using the mysql unit from freepascal). So i wrote a small pascal prg accessing a mysql database , it worked fine,so i copied it into a lazarus unit(the callback off a button) i tryed to run this.The program display the correct result and then stop misteriusly. gdb does not work, so i got completely lost, can you help me? I`m sending the two codes(the unit from lazarus and the pas prg).

unit uni1;
{$mode objfpc}{$H+}
interface
uses
  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, LResources, Buttons,mysql;
type
  TForm1 = class(TForm)
    Button1: TBUTTON;
    procedure Button1CLICK(Sender: TObject);
  private
    { private declarations }
  public
    { public declarations }
  end;
var
  Form1: TForm1;
  db:PMYSQL;
  tmp:TMYSQL;
  coluna:TMYSQL_ROW;
  buffer:PMYSQL_RES;
implementation

{ TForm1 }

procedure TForm1.Button1CLICK(Sender: TObject);
begin
     db:=mysql_connect(@tmp,'localhost','root',nil);
     mysql_select_db(db,'delara');
     mysql_query(db,'select * from usuarios');
     buffer := mysql_store_result(db);
     coluna:=mysql_fetch_row(buffer);
     showmessage(coluna[0]);
     mysql_close(db);
end;
initialization
  {$I uni1.lrs}
end.
program teste;
uses mysql;
var
db:PMYSQL;
tmp:TMYSQL;
coluna:TMYSQL_ROW;
buffer:PMYSQL_RES;
begin
     db:=mysql_connect(@tmp,'localhost','root',nil);
     mysql_select_db(db,'delara');
     mysql_query(db,'select * from usuarios');
     buffer := mysql_store_result(db);
     coluna:=mysql_fetch_row(buffer);
     writeln(coluna[0],coluna[1]);
end.

Reply by email