I discovered that calling repeatedly SQLConnect() and SQLDisconnect() from various thread of the same process can cause a crash of the application.
I observed this behaviour in a testing application running on Windows Server 2003 R2 64 bit SP2.
If calls to SQLConnect() are serialized by means of a critical section, it seems the crash will not occur.