Panagiotis Sidiropoulos wrote:
After testing sqldb and could not make it work for me, I installed and
try with TMySQLDatabase and TMySQLDataset found in
lazarus/components/mysql folder. Proper package version installed
related to Mysql server version.

TMySQLDatabase succesfuly connect to the server but TMySQLDataset never
return any data regardless query is, not even when is as simple as
"select * from xTable".

A general note on MySQL: As far as I know, the MySQL database components are 
not very well maintained. FPC developers have had bad experience with MySQL 
header files in the past, discouraging them to develop the MySQL components. As 
an alternative you can use another database such as PostGreSQL or 
Firebird/Interbase.

For MySQL connectivity, you can also try the TODBCConnection component. I 
realize there is very little documentation on this component, so maybe a small 
example can help people out. Maybe someday I'll write a Wiki page explaining 
how to connect to several databases using the TODBCConnection component, but 
here goes an example for a MySQL DBMS:

with MyODBCConnection do
begin
 UserName := "MyUserName';
 Password := 'MyPassword';             // note: empty password will be 
interpreted as no password
 Driver   := 'MySQL ODBC 3.51 Driver'; // on Unix/UnixODBC the driver name may 
be different, e.g. MySQL
 Params.Add('DATABASE=MyDatabase');    // or use a USE MyDatabase statement of 
course :)
 Params.Add('PORT=3306');              // optional
 Params.Add('SERVER=121.122.123.124'); // optional; note: do not use the 
HostName property; it is ignored as ODBC doesn't specify a standard property 
for it
end;

Note: you need to have the MyODBC driver installed (this is the MysQL ODBC 
driver).
You can also use a file DSN (a .dsn file containing connection properties) and 
specify it by the FileDSN property. This is an ODBC feature.

For details on supported MySQL parameters, see e.g. 
http://mysqld.active-venture.com/MyODBC_connect_parameters.html.

Regards,

Bram

_________________________________________________________________
    To unsubscribe: mail [EMAIL PROTECTED] with
               "unsubscribe" as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to