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 : DNS-less ODBC connection via ADOSearch Forum

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

 New Topic 
 
 Post Reply 
[1]  
 DNS-less ODBC connection via ADO 
 Author   Message 
  kcook 
  
 Group: Members 
 Posts: 6 
 Joined: 2006-04-27 
 Profile
 Posted : 2006-04-27 01:47:05

I am evaluating the product. We have about 20 company files that i am attempting to pull GL and transaction data from and put into an MS Access table for aggregate reporting purposes. So, my goal is to loop through all 20 files and append the needed data from each file to my Access table. Here is my ADO connection string:

sConnectString = "DRIVER={QODBC Driver for QuickBooks};SERVER=QODBC;DFQ=R:\Finance\QuickBooks\Company1.QBW;OpenMode=S;OLE DB Services=-2;OptimizerOn=No;"

When I run this one i get the error:  "Begin Session Failed Error = 80040403 Could not open the specified Quickbooks company file."

If  I open the file manually in Quickbooks and use this connecting string, everything works fine:

sConnectString = "DRIVER={QODBC Driver for QuickBooks};SERVER=QODBC;DFQ=.;OpenMode=S;OLE DB Services=-2;OptimizerOn=No;"

So my question is, how can i get the QODBC driver to open the QB file via a DNS-less connection? I would prefer bypassing DNS since that would require me to set up DNS for each QB file.

Thanks...

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-04-27 07:56:16

Each company file must be configured for auto-login, see: How do I setup QODBC to auto-login into QuickBooks and start it if it's not running? and only one company file can be opened at the one time (a QuickBooks limitation). So you will need to open and close each connection.

BTW: Our experience with MS Access is that linked tables are not closed until the mdb is closed.

 

  Top 
  kcook 
  
 Group: Members 
 Posts: 6 
 Joined: 2006-04-27 
 Profile
 Posted : 2006-04-27 08:19:00
Thanks for your reply. I'd previously setup the company file for auto login so that's not the problem. I'm using QB 2006 Simple Start which only runs in Single User mode. Could that be the problem? 

  Top 
  Anonymous 
  
 Group: Unknow 
 Posts: Unknow 
 Joined: Unknow 
 Profile
 Posted : 2006-04-27 08:32:02

No, I run in single user and multi-user modes all the time. I suggest you setup different auto-login DSN connections for each company file. If you have set it up correctly, you will be able to go into VB Demo and connect without having QuickBooks open, then close the connection, and connect using another DSN/company file etc. Once they work correctly, your DSN-less connection will work too.

Note: QuickBooks can only have one company file open at the one time.

 

  Top 
  kcook 
  
 Group: Members 
 Posts: 6 
 Joined: 2006-04-27 
 Profile
 Posted : 2006-04-27 08:36:03

Maybe i'm just not getting this but i thought a dns-less connection meant i didn't have to set up dns for each company file. Do I have that wrong? Must i set up dns for each company file even when i'm attempting a dns-less connection?

Thanks

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-04-27 18:27:27
Sorry, you must go through authorizing each company file to use QODBC in QuickBooks. This is a QuickBooks security requirement and is a once off procedure. To do this, you must connect QODBC to each company file in the first place before using a DSN-less connection. 

  Top 
  kcook 
  
 Group: Members 
 Posts: 6 
 Joined: 2006-04-27 
 Profile
 Posted : 2006-04-27 22:29:15

The first company i attemped to connect to via dns-less connection i had previously set up dns and connected, authorized, etc. So, i got in via DNS. Then i tried the suggested dns-less connection per previous post:

sConnectString = "DRIVER={QODBC Driver for QuickBooks};SERVER=QODBC;DFQ=R:\Finance\QuickBooks\Company1.QBW;OpenMode=S;OLE DB Services=-2;OptimizerOn=No;"

It only works if i have the file open in quickbooks with DFQ=. When I set DFQ= to <my file name> as in above, that's when i get the error. So, i've done everything you've suggested i do and the dns-less connection still does not work.

Thanks...

 

  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-04-28 08:11:05

I assume the error is still:  "Begin Session Failed Error = 80040403 Could not open the specified Quickbooks company file"?

If so, check that "R:\Finance\QuickBooks\Company1.QBW" is the correct path and try leaving QuickBooks closed (not running).

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to