Sign in Join

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

Mailing lists / fpc-pascal / 2002-08

FCL bug? [ was: fpc and MySQL]

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

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

Fernando Lozano

Hi Michael,

Show quoted text 8 lines
> > > > Maybe zlib is missing, some distro's have zlib in libc, some not. > > > > > > But adding -lz to the command line don't solve the problem. :-( > > > > Adding -lz to the compiler command-line is useless. This will only > > display the logo of the compiler. > > So there's no to add a library to the linking phase on the command line? I must use compiler directives?

Thanks a lot. Now it works.

But the same program using the MySQL FCL unit presents on Linux the same bug as on Windows: When I get a field value using method "AsString", the value is mixed with previous values.

The program using the mysql unit:

bash$./testemysql
codigo: INFO, nome: Informatica
codigo: MARK, nome: Marketing
bash$

The program using the FCL:

bash$ ./testedbmysql
codigo: INFO, nome: Informatica
codigo: MARKrmatica, nome: Marketing
bash$

It may be my mistake? Here's the program:

program testedbmysql;
uses db, mysqldb;
const
    host = 'localhost';
    banco = 'banco';
    login = 'teste';
    senha = 'senha';
var
    bd : TMysqlDataset;
begin
    bd := TMysqlDataset.Create (nil);
    bd.Host := host;
    bd.Database := banco;
    bd.User := login;
    bd.Password := senha;
    bd.SQL.text := 'SELECT codigo, nome FROM departamento';
    bd.Open;
    while not bd.EOF do begin
	write ('codigo: ', bd.Fields[0].AsString, ', ');
	write ('nome: ', bd.Fields[1].AsString);
	writeln;
	bd.Next;
    end;
    bd.Close;
    bd.Free;
    readln;
end.

The program works the same way on Linux and on Windows (and shows the same bug).

[]s, Fernando Lozano

Reply by email