Lazarus
Programming => Databases => Topic started by: LigH on January 30, 2007, 06:39:26 pm
-
- Windows XP SP2
- MySQL 4.1.14 for Win32 as NT service (mysqld.exe)
- all the DLL files from the MySQL installation copied into the project directory
- fresh installed Lazarus version 0.9.20
- TMySQL41Connection <-=-> TSQLQuery <-=-> TSQLTransaction
connMySQL.HostName := '';
connMySQL.DatabaseName := 'mysql';
connMySQL.UserName := 'root';
connMySQL.Password := '';
try
connMySQL.Open;
(EDatabaseError) connMySQL : Server connect failed.
connMySQL.HostName := 'localhost';
connMySQL.DatabaseName := 'mysql';
connMySQL.UserName := 'root';
connMySQL.Password := '';
try
connMySQL.Open;
(EDatabaseError) connMySQL : Server connect failed.
connMySQL.HostName := '{WINS name}';
connMySQL.DatabaseName := 'mysql';
connMySQL.UserName := 'root';
connMySQL.Password := '';
try
connMySQL.Open;
(EDatabaseError) connMySQL : Server connect failed.
#0 fpc_raiseexception(<incomplete type>, <incomplete type>, <incomplete type>) at :0
#1 DATABASEERROR(<incomplete type>, <incomplete type>) at :0
#2 MYSQLERROR(<incomplete type>, <incomplete type>, <incomplete type>) at :0
#3 TMYSQL41CONNECTION__CONNECTMYSQL(<incomplete type>, <incomplete type>, <incomplete type>, <incomplete type>, <incomplete type>) at :0
#4 TMYSQL41CONNECTION__CONNECTTOSERVER(<incomplete type>) at :0
#5 TMYSQL41CONNECTION__DOINTERNALCONNECT(<incomplete type>) at :0
#6 TDATABASE__SETCONNECTED(<incomplete type>, <incomplete type>) at :0
#7 TDATABASE__OPEN(<incomplete type>) at :0
#8 TFMBBEDIT__FORMCREATE((^TOBJECT) $139560, (^TFMBBEDIT) $139560) at BBUnit.pas:48
#9 TCUSTOMFORM__DOCREATE((^TCUSTOMFORM) $139560) at customform.inc:614
#10 TCUSTOMFORM__CREATE((^TCOMPONENT) $d53b0, (POINTER) $1, (^TCUSTOMFORM) $139560) at customform.inc:1297
#11 TAPPLICATION__CREATEFORM($554ed0, void, (^TAPPLICATION) $d53b0) at application.inc:1523
#12 main at Project1.lpr:16
Did I miss anything to set up? Maybe some Params[]?
__
BTW: I do not think the Wiki tutorial is already comprehensive. What I definitely miss, are facts about allowed values for several properties. For example, one should know if the value 'localhost' enables the special socket mode, and if I want to connect to a different PC in a local network, I want to know if I am allowed to use the WINS name as HostName, or maybe need to use an IP address...
-
The reason seems to be that the Lazarus IDE somehow locks the libmysql.dll -- after starting the IDE, debugging the application works once; the next time I debug it, the mentioned error appears until I close Lazarus and restart it.
I also tried "connMySQL.Connected := true;" instead of "connMySQL.Connect;" -- which might be more reliable, I was told.
-
Reseting the debugger in the Start menu (in the Lazarus IDE) helped avoiding the restart of the whole IDE.
So I finally made the application read in a MySQL database; but after several thousand accesses, the same blurry error message appeared. So I fear whose routines are not yet reliable.