Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : [QODBC] QB Open Connection Failed. Error = 80040402Search Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v6 Forum

 New Topic 
 
 Post Reply 
[1]  
 [QODBC] QB Open Connection Failed. Error = 80040402 
 Author   Message 
  LoriB 
  
 Group: Members 
 Posts: 4 
 Joined: 2008-10-18 
 Profile
 Posted : 2008-12-02 04:40:19

Hi,

I am trying to connect my vb.net application to QuickBooks using the QODBC driver, using the followng code:

-------------------------------------------------------------------------------------------------

Dim cnQODBC As System.Data.Odbc.OdbcConnection
Dim daQODBC As
System.Data.Odbc.OdbcDataAdapter
Dim dsQODBC As
System.Data.DataSet

cnQODBC = New System.Data.Odbc.OdbcConnection("Dsn=QB_DB;")
cnQODBC.Open()

daQODBC = New System.Data.Odbc.OdbcDataAdapter("SELECT AccountNumber, FullName, CompanyName FROM Customer", cnQODBC)

dsQODBC = New System.Data.DataSet

daQODBC.Fill(dsQODBC)

DataGridView1.DataSource = dsQODBC

-------------------------------------------------------------------------------------------------

The DSN connection works fine with the vb demo application, but when I run this code in Visual Studio, it breaks at cnQODBC.Open() with the error:

"ERROR [00000] [QODBC] QB Open Connection Failed. Error = 80040402, Exception in OpenConnection: An existing connection was forcibly closed by the remote host  ERROR [00000] [QODBC] QB Open Connection Failed. Error = 80040402, Exception in OpenConnection: An existing connection was forcibly closed by the remote host"

Thanks for your help!

Lori

 

 

 

 

 

 

 

 

 

 

 

 

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2008-12-03 16:04:43
Your company file needs to be in Multi-User mode for multiple connections. Also, QuickBooks can only have one company file open at a time, so it's best to set up unattended mode access, see: How do I setup QODBC to auto-login into QuickBooks and start it if it's not running?  

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to