[QODBC-Desktop] Troubleshooting: Modal Window causes qbw32.exe to hang in background when opened with QODBC
Posted by brad waddell on 12 March 2009 05:21 PM
Troubleshooting: Modal Window causes qbw32.exe to hang in background when opened with QODBC
Problem Description 1
I'm running PHP scripts on a Win 2k server to access my company file, and export certain tables to CSV files. I've checked the option to allow QODBC to log in automatically, and I've unchecked the Launch QuickBooks UI option. Frequently the scripts will error as below:
Error = 80040414, A modal dialog box is showing in the QuickBooks user interface....
and while my PHP script will stop running, an instance of qbw32.exe will continue running and the scripts will error with the same message until I manually kill the qbw32.exe process.
The problem here is that the QuickBooks company file is being opened in both modal and non-modal modes at the same time, so if for example, someone opens an invoice and your script then tries to create invoices, then you will get an "Error = 80040414, A modal dialog box is showing in the QuickBooks user interface...." which has nothing to do with alerts or pop-up messages. QuickBooks is simply saying that a modal connection is active for this part of QuickBooks and you need to wait.
Normally the other user would eventually close the Invoice modal screen allowing your script retries be successful.
BTW: I believe that Intuit has made some errors in making a number of user interface (UI) operations in QuickBooks "modal" to Integrated Applications such as QODBC.
Problem Description 2
That is the problem though. Even after the other users have all logged out, and my scripts have recorded the error message, and closed the QODBC connection and ended, the qbw32.exe process remains. Here is an example of how my script works if that helps explain the process, all pseudo-code:
Customer script starts
I know that the not successful condition is being fulfilled because the error message is appended to the customer script error log, and the return code is recorded as 2, not 0. When the script is successful (which is most of the time), the csv file is created properly. I hope this makes the process a little clearer, I'm just curious if I'm closing the script prematurely, or if there is something else causing that process to hang. When the error occurs, any repeat attempts by the script to run will cause it to give the modal window error until I manually kill the process.
Sorry, I'm not too sure whether the other UI users are on the same server (Terminal Server Sessions) or on their own workstations? If you are only reading info out of the Customer table, then you shouldn't be getting modal errors. I only get modal errors if I try to create for example an invoice and have the invoice model pane running in QuickBooks on an invoice for the same customer.
I suggest you try to find out what modal pane is interfering here. Walk around all the users see what they are doing in their QuickBooks session. The company file will also need to always be in Multi-User mode! If the company file is set to single user, then your script won't work.
Problem Description 3
I am having the same trouble, but am not getting modal error messages. It seems like when I am logged into the server where QODBC and our QB db live, then we don't have any problems...but when I'm not logged into it our script will run fine the first time, but QBW32.EXE remains open and no further scripts will run without erroring out (which also causes our sales/job management server app to lock up). The only way to fix it is to log into the server and kill the QBW32.EXE process. None of our QB users are getting any error messages, QBW32.EXE just won't close on its own if I'm not logged into the server. Any help would be appreciated as our sales staff is getting ready to kill me if I can't get this fixed.
The server console (local session) on the server needs to be logged into always. The server can't be left on a login screen waiting for you to come along. Why?, because of QuickBooks is an application .... not a "true" service.
Note: Intuit changed unattended access and the DBMS backend in QuickBooks 2006. In fact, there have been ongoing issues even with R7. The server console (local session) on the server needs to be logged into always. Upgrading to the latest build of QuickBooks might fix this.