I've builded a .dll (C++ builder and MyDAC 40028) witch is acting as a communicationlayer between my software and the databaseserver.
I still have some strange issues:
MyConnection problem:
After a MyConnection is connected and i swith of the server..... the MyConnection component is still saying that it has connection (MyConnection->Connected() == true)..... ( thats impossible when the server is switched off)
Closing problem:
By closing the driver while it is connecting with a server i cannot stop the MyConnection. Is it possible to destroy the connect() action?
Please help (oh sorry for my bad english)
MyConnection->Connected says its connected..... but server is switched off
> the MyConnection component is still saying that it has connection
> >(MyConnection->Connected() == true).....
MyDAC components doesn't check connection to the server all the time. The connection is checked only if it's necessary to get from the server any information. But you can check the connection manually using MyConnection.Ping.
>Is it possible to destroy the connect() action?
What do you mean by destroying the connection action? What is the reason to do this?
> >(MyConnection->Connected() == true).....
MyDAC components doesn't check connection to the server all the time. The connection is checked only if it's necessary to get from the server any information. But you can check the connection manually using MyConnection.Ping.
>Is it possible to destroy the connect() action?
What do you mean by destroying the connection action? What is the reason to do this?
In someway it takes quite a while to connect over a network with a mysql server. This is no problem because i made a thread within the connect action. But the problem is: when i want to close my program i have to wait for all the threads to be closed because i cannot stop the thread while the myconnection is trying to connect with the server.
But i think this is a problem in Microsoft Windows because when i am browsing the network, windows hangs a few seconds to....
I thought maybe it is possible to destroy the myconnection component so it is not searching for the server anymore.
But i think this is a problem in Microsoft Windows because when i am browsing the network, windows hangs a few seconds to....
I thought maybe it is possible to destroy the myconnection component so it is not searching for the server anymore.
I find that one of the great things is that connections are made very quickly.. Check your settings, also if your server is connected to internet and the DNS servers. When connecting, mysql resolves the name of connection to checkup the user/privileges.
I normally add the
to the MySQL config files (my.ini under windows, my.cnf under linux). Look at http://dev.mysql.com/doc/refman/5.1/en/dns.html for more details.
I normally add the
Code: Select all
skip-name-resolve
It's working... connecting to the server is really fast! thank you very mutch.
I found another problem in my DLL.
When i want to close my application (which is using my dll) i got an error.
Is the following code correct? ( i know this is not the forum for these questions but nobody can answer it.... so i hope somebody can help me.)
#pragma argsused
BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
return (true);
}
//---------------------------------------------------------------------------
std::auto_ptr ASBSQLForm(new TASBSQLForm1(NULL));
extern "C" _declspec(dllexport) AnsiString __stdcall ASBDD_Connection_Connect( void )
{
ASBSQLForm->ASBDDInsertSelectConnectEvent = true;
return ("true");
}
I found another problem in my DLL.
When i want to close my application (which is using my dll) i got an error.
Is the following code correct? ( i know this is not the forum for these questions but nobody can answer it.... so i hope somebody can help me.)
#pragma argsused
BOOL WINAPI DllEntryPoint(HINSTANCE hinstDLL, DWORD fwdreason, LPVOID lpvReserved)
{
return (true);
}
//---------------------------------------------------------------------------
std::auto_ptr ASBSQLForm(new TASBSQLForm1(NULL));
extern "C" _declspec(dllexport) AnsiString __stdcall ASBDD_Connection_Connect( void )
{
ASBSQLForm->ASBDDInsertSelectConnectEvent = true;
return ("true");
}