WWW-service crashes while starts ISAPI filter dll (VC++ 6) when trying to connect to Sybase database through ODBC. I need to open ODBC connection on filter startup and keep it running to speed up base-related operations. So I call SQLConnect from DllMain and try to connect base (see example of code). It works perfect with Oracle database, but it doesn't work with Sybase (though compiled as Win32 Application it works with Sybase too). Code ======================================================================== #include #include #include #include #include #define ODBC_SUCCESS(rc)\ (((rc)==SQL_SUCCESS)||((rc)==SQL_SUCCESS_WITH_INFO)) HENV henv; HDBC hdbc; HSTMT hstmt; BOOL WINAPI DllMain(HINSTANCE hInst, ULONG ulReason, LPVOID lpReserved) { switch (ulReason) { case DLL_PROCESS_ATTACH: SQLAllocEnv(&henv); SQLAllocConnect(henv, &hdbc); RETCODE rc; // here www-service freezes rc=SQLConnect( hdbc, (unsigned char *) "DSN", SQL_NTS, (unsigned char *) "LOGIN", SQL_NTS, (unsigned char *) "PASSWORD", SQL_NTS ); if (!ODBC_SUCCESS(rc)) { ... // connection error } DisableThreadLibraryCalls(hInst); break; case DLL_PROCESS_DETACH: SQLDisconnect(hdbc); SQLFreeConnect(hdbc); SQLFreeEnv(henv); break; default: break; } return true; } BOOL WINAPI GetFilterVersion(HTTP_FILTER_VERSION * pVer){ ... } DWORD WINAPI HttpFilterProc ( HTTP_FILTER_CONTEXT* pFC, DWORD NotificationType, VOID* pvData ){ ... } ======================================================================== If somebody know how to solve this problem - help needed.