Error - QB Begin Session Failed. Error = 8004041c |
Author |
Message |
Tech |
|
Group | : Members |
Posts | : 5 |
Joined | : 2008-11-14 |
|
Profile |
|
Posted : 2008-11-14 11:00:00 |
Hi there,
I am using QODBC version 5.0 and Quickbooks Pro 2005 and when I run a report in my Java file I get the following error:
java.sql.SQLException: [QODBC] QB Begin Session Failed. Error = 8004041c, An internal QuickBooks error occurred while trying to access the QuickBooks company data file.
The same program was working on my old PC which had Quickbooks Pro and QODBC 5.0 and I did a transfer to the new PC and now its not working. Any suggestions? It definitely seems like there is a version conflict but I am not sure.
Appreciate your help,
Tech |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-11-14 17:23:48 |
|
|
|
Tech |
|
Group | : Members |
Posts | : 5 |
Joined | : 2008-11-14 |
|
Profile |
|
Posted : 2008-11-15 03:37:18 |
Hi Tom
Thanks for the reply. VBDemo is the first thing I tried to connect and I noticed that I did not have a File DSN and so I created one and now I am able to connect fine in VBDemo. I have followed the procedure that you have sent in the link for AutoLogin and that is also all set in my application. Any more suggestions for me getting this error?
Thanks,
Tony |
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-11-15 10:28:39 |
Java would need a System DSN and hopefully you have configired the QODBC DCOMs and have a Web server edition of QODBC? If your new computer has a new version of QuickBooks and you are not running QuickBooks Pro 2005, it's time to download QODBC v9 and purchase a new copy.
If your new computer is a Microsoft Vista machine you will need to upgrade both your copy of QuickBooks and QODBC. |
|
|
|
Tech |
|
Group | : Members |
Posts | : 5 |
Joined | : 2008-11-14 |
|
Profile |
|
Posted : 2008-11-21 09:00:37 |
Hi Tom
I downloaded the new version of QODBC 9.0 (evaluation version) and followed all the steps to configure it to work with Quickbooks 2005. I also tested connection with VB Demo but still when I run my Java file I am getting the same following error:
java.sql.SQLException: [QODBC] QB Begin Session Failed. Error = 8004041c, An internal QuickBooks error occurred while trying to access the QuickBooks company data file.
I am running Windows XP.
Very frustrating - can you please advise?
Thanks,
Tony |
|
|
|
Tech |
|
Group | : Members |
Posts | : 5 |
Joined | : 2008-11-14 |
|
Profile |
|
Posted : 2008-11-21 09:03:44 |
Here is my Java code if that helps at all:
try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance(); Connection con = DriverManager.getConnection("jdbc:odbc:QuickBooks Data"); Connection con1 = DriverManager.getConnection("jdbc:odbc:ABC");
qrystr="sp_report OpenInvoices show Text, Blank, TxnType, Date, RefNumber, PONumber, Terms, DueDate, Aging, OpenBalance, Memo parameters DateMacro = 'Today'";
|
|
|
|
Tom |
|
Group | : Administrator |
Posts | : 5510 |
Joined | : 2006-02-17 |
|
Profile |
|
Posted : 2008-11-21 20:24:57 |
|
|
|
Tech |
|
Group | : Members |
Posts | : 5 |
Joined | : 2008-11-14 |
|
Profile |
|
Posted : 2008-11-22 03:30:06 |
Hi Tom,
Thanks a lot - Your tip of "QuickBooks must be closed (not running) when you start your JAVA application" did the trick :-)
Thanks,
Tony |
|
|
|