[QODBC-Desktop] I'm getting the error message "Cannot close company file" / Getting "Cannot close QuickBooks" message from QuickBooks after closing my application.
Posted by Wilson (QODBC Support) on 08 May 2012 07:34 AM
|
|
Troubleshooting: Getting a "Cannot close QuickBooks" message from QuickBooks after closing my application.Problem Description 1:Using QODBC with your application, always get the "Cannot close QuickBooks" message after closing the application. Solutions 1:The cause of the issue is connection was not closed by your application. Please make sure your application is sending the disconnect command to QODBC. If you use Microsoft Access, please close the MS Access application to disconnect the connection. MS Access will keep the connection open until the application is closed.
If you have killed/aborted any process, this means QODBC and QuickBooks have not received the disconnect command. QuickBooks will still have the connection flag ON.
You could manually close QuickBooks via Windows Task Manager. Click Ctrl+Alt+Del to open the task manager, switch to the Processes window, and locate and terminate the QBW32.EXE process to close QuickBooks.
Solutions 2:Please check your code to see if you have added code to close and dispose of the connection. In case you are using OdbcDataReader ( Please make sure you always call Close before you dispose of the object.). Here is an example of a VBS code: Const adOpenStatic = 3 Please notice the final part we use this: oRecordset.Close To close the connection. And we also kindly suggest you make sure all the connection references are in Data Readers or other objects where the connection is used.
Problem Description 2:I use Microsoft Access 2010 and QODBC to pull data out of Reckon Accounts. If I link a table with Reckon accounts, I get the message, "The company file cannot be closed at this time because there is another application (addin product or background task) that is using it. Before closing the company file, you must either close that application or instruct the application to end its session with Reckon Accounts". This happens despite MS Access being already closed.
Solution 3: The problem is only due to linking a file to the Reckon account via QODBC.
If you still face the issue, Close MS Access and try again. If you are working with multiple company files, I suggest you add a 5-10 seconds gap between closing and opening the connection to another company. QuickBooks require this time to close the existing company file and make the application available to load another company file.
Additional Information for Service/Task Manager based applications
Tag: QuickBooks does not close when an application is turned off. The company file cannot be closed, unable to close the company file. | |
|
There might be some active connection between QODBC & QuickBooks, due to this you are getting this error. You need to close all active connection between QODBC & QuickBooks to close QuickBooks company file.
oRecordset.Open sSQL, oConnection, adOpenStatic, adLockOptimistic
sMsg = "**********************" & Chr(10)
Do While (not oRecordset.EOF)
sMsg = sMsg & oRecordSet.Fields("Name") & Chr(10)
oRecordset.MoveNext
Loop
sMsg = sMsg & "**********************" & Chr(10)
MsgBox sMsg "
During this bit of code, how would I do an import of a table without establishing a new connection.
Right now I use the command TransferDatabase acimport, "ODBC Database", "ODBC; DSN Quickbooks Data; DFQ=C: \Users ... This creates it's own connection separate to your code. How do I close that connection from an import OR how do I incorporate an import into your code?
It's imperative that I get this done because I need Quickbooks to be accessible because of the single-user mode. If there is anything you can help with then please do.
Thanks!
I would like to share that when you use DoCmd, MS Access keeps the connection open & due to this QuickBooks Company file can't close until MS Access database is closed. MS Access will close connection to QuickBooks after closing MS Access.
So you need to close MS Access, then try to close company.
If you are still facing the issue, Please raise a support ticket to the QODBC Technical Support department from below mentioned link & provide requested information:
http://support.flexquarters.com/esupport/index.php?/Tickets/Submit
We may need the following information, Please attach below listed files when replying to the ticket.
1) Screenshot of QODBC Setup Screen -- > About
2) Screenshot of the issue you’re facing.
Share Entire Log Files as an attachment in text format from
3) QODBC Setup Screen -- > Messages -- > Review QODBC Messages
4) QODBC Setup Screen -- > Messages -- > Review SDK Messages