var mydriver:IMysqlPlainDriver;
mysqldb:PZMysqlConnection;
begin
mydriver := Tzmysql41PlainDriver.create()
mydriver.init(mysqldb);<-- causes access violation, @MYSQL_API.mysql_init = $00000000
...
end;
what am I doing wrong, is there another step I am missing?
AV (access violation) when calling TzMysql41PlainDriver.init
Moderators: gto, EgonHugeist
-
- Fresh Boarder
- Posts: 2
- Joined: 14.04.2009, 22:31
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Hi Max,
Is this just a first try or did this way of working work before I partially rewrote the Plaindriver stuff?
I think adding mydriver.Initialize; should do the trick. This effectively loads the dll and assigns the function addresses.
Can you tell why you want to use the zeoslib plaindriver layer directly? I'm just curious. Because it means you would have to do all data fetching code yourself (which is quite cumbersome using mysql) and that code is not portable to other databases. Of course, when you only want to use some simple calls (like getting the library version) this would be the most efficient way of working. Otherwise i'd suggest to use at least the zdbc layer.
Mark
Is this just a first try or did this way of working work before I partially rewrote the Plaindriver stuff?
I think adding mydriver.Initialize; should do the trick. This effectively loads the dll and assigns the function addresses.
Can you tell why you want to use the zeoslib plaindriver layer directly? I'm just curious. Because it means you would have to do all data fetching code yourself (which is quite cumbersome using mysql) and that code is not portable to other databases. Of course, when you only want to use some simple calls (like getting the library version) this would be the most efficient way of working. Otherwise i'd suggest to use at least the zdbc layer.
Mark
-
- Fresh Boarder
- Posts: 2
- Joined: 14.04.2009, 22:31
didn't work
@MYSQL_API.mysql_connect is still nil
though @MYSQL_API.mysql_realconnect seems to work.
(I had tried the Initialize method before but gave up when mydriver.connect didn't work)
perhaps the plain api needs to check for nil functions and raise some exceptions?
though @MYSQL_API.mysql_realconnect seems to work.
(I had tried the Initialize method before but gave up when mydriver.connect didn't work)
perhaps the plain api needs to check for nil functions and raise some exceptions?