Additional
dbCAP
AnyDAC
ThinDAC
NCOCI8
Topic: Indy 9 conflict?
Indy 9 conflict?
Posted: 2007/05/19 09:11
 
Hello,
I am using Turbo Delphi 2006 and I use a TCP server, a TCP client and AnyDAC for a MySQL connection. The application worked just fine before adding MySQL support; however, I now am experiencing some difficulties: if I connect using the client first, then connect to the MySQL DB, everything is normal. If I connect to MySQL and only then I use the client to connect to the other application, the application crashes and won't start unless I reboot (even though it appears it has completely terminated, not appearing in any process list). I managed to trace the problem back to Indy. I am using Indy 9, as the latest version needs .NET framework (and I am doing my best to avoid using it).
Could you please try to tell me what to do to solve the issue?
Thank you in advance,
Alex.
Re:Indy 9 conflict?
Posted: 2007/05/20 01:22
 
Hello

Although I does not see, how your issue is related to AnyDAC, but will try to help. Probably, this is related to the sockets layer initialization. Try to add following code to the daADPhysMySQLWrapper.pas:


 Uses   WinSock; ....................................... var   WSADataTWSAData; procedure WSStartup; var   ErrorCodeInteger; begin   ErrorCode := WSAStartup($0101WSAData);   if ErrorCode <> 0 then     raise Exception.Create('WSAStartup'); end; procedure WSCleanup; var   ErrorCodeInteger; begin   ErrorCode := WSACleanup;   if ErrorCode <> 0 then     raise Exception.Create('WSACleanup'); end; initialization   WSStartup; finalization   WSCleanup; end.



Regards,
Dmitry
Re:Indy 9 conflict?
Posted: 2007/05/20 02:25
 
Hello,

Thank you for your fast reply. I experienced a major system crash and had to restore everything from back-ups last night. It now seems to compile and run correctly on both my machine and the system I use for tests without modifying the original component. However, I added the code you posted and will let you know if anything goes wrong in the future.

Thank you very much for your support,
Alex.