Hi Michael,
Show quoted text 8 lines
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
