I have tried to connect into a mysql server calling the functions of libmysq.dll with loadLib32() function.
The function mysql_init() for prepare the threads and environment to connect on the database server is running perfectly! I get a code handle for this!
But, some functions like mysql_real_connect() and others... they are not running correctly.
The fivewin, at runtime, crashing with a GPF error!
Bellow, I describe my code... Please, help me!
- Code: Select all Expand view
# include "Fivewin.ch"
STATIC cMySqlLib32
STATIC hHandleConexao
// ------------
FUNCTION main()
// ------------
cMySqlLib32 := loadLib32( "libmysql.dll" )
hHandleConexao := mysql_init()
IF !mysql_real_connect( hHandleConexao, "127.0.0.1", "root", "mysql", NIL, 0, NIL )
? "Not connected!"
ELSE
? "Connected!"
ENDIF
mysql_close( hHandleConexao )
RETURN( NIL )
*** *************************************** ****
*** Declaration of funciotns at libmysq.dll ****
*** *************************************** ****
DLL32 STATIC FUNCTION mysql_init( mysql AS LPSTR ) AS LONG PASCAL FROM "mysql_init" LIB cMySqlLib32
DLL32 STATIC FUNCTION mysql_close( mysql AS LPSTR ) AS LONG PASCAL FROM "mysql_close" LIB cMySqlLib32
DLL32 STATIC FUNCTION mysql_real_connect( mysql AS LPSTR, ;
host AS LPSTR, ;
user AS LPSTR, ;
passwd AS LPSTR, ;
db AS LPSTR, ;
port AS LPSTR, ;
unix_socket AS LPSTR, ;
client_flag AS LPSTR ) AS BOOL PASCAL FROM "mysql_real_connect" LIB cMySqlLib32