I recently ran into an interesting issue where the qODBC bridge we use to connect to QuickBooks from our custom application would fail to properly initialize QuickBooks. In principal the qODBC bridge is an ODBC driver that connects to QuickBooks via QuickBooks's API by launching an instance of the actual QB GUI and then communicating that way with it. It follows that our custom application connects in turn to qODBC to perform database related calls to QuickBooks.
Recently after a server patching we started receiving these error messages when trying to connect to QuickBooks:
Unhandled Exception: System.Exception: Cannot connect to QuickBooks: ERROR  [QODBC] QB Begin Session Failed. Error = >80040408, Could not start QuickBooks. ERROR  [QODBC] QB Begin Session Failed. Error = 80040408, Could not start QuickBooks. ---> System.Data.Odbc.OdbcException: ERROR  [QODBC] QB Begin Session Failed. Error = 80040408, Could not start QuickBooks.
A support request with qODBC did not go anywhere - everything they recommended I have already tried. So I rolled up my sleeves and used my grey matter:
This sounded like a network / file sharing issue at its core, though the obvious symptoms did not reflect this. I looked at the status of QuickBooks Database Server Manager - the app that helps with the sharing of company files across servers and dealing with multi user access issues. I found the status was STOPPED. Trying to start it by launching QuickBooksDB26 service did not work - the service started the stopped with this error in the event log:
Could not start server
not very helpful. Looking at C:\ProgramData\Intuit\QuickBooks\DBStartup.log revealed a bit more insight:
Unable to initialize requested communication links
Error in command near "-1M"
this pointed me to perhaps a port issue.