[QODBC-Desktop] How to Use QODBC with Multiple Company Files
Posted by Rajendra Dewani (QODBC Support) on 14 April 2014 04:03 PM

How to Use QODBC with Multiple Company Files


When there are multiple QuickBooks company files located on one machine, then how do we use only one copy of QODBC to access those company files? Please note that in one machine, QODBC can only access one company file at one time. So it is impossible to use QODBC to access multiple company files locally at one time. But we can setup QODBC to access this company files one by one.

Setup Multiple DSN:

The first method we can use is to create multiple DSNs and setup each DSN to point to one company file.

Here we create one DSN and setup it to point to one company file as an example to show you how to do this. You can do the same to the rest of your DSNs.

When your application is 32-bit:

Go to Windows Start->All Programs->QODBC for use with QuickBooks->Select "Configure QODBC Data Source" option.

Select "System DSN" tag and click "Add" button.

In the "Create New Data Source" window, select "QODBC Driver for QuickBooks" option

Click "Finish" Button. In DSN Setup Screen, input the DSN name. And in "Locate a company file" option, input correct company file store path.

If you could not find company store path, please press "F2" key in QuickBooks UI. In the "Product Information" window, you will find correct store path.

When the DSN setup is completed, please open QuickBooks and log in as Admin in Single user mode to get access certificate for QODBC. If you are not familiar with this part, please refer to This Article for more information.

After you assigned each company files one DSN, then you can use these DSNs to access company files. When you want to access another company file, just release the connection of current DSN and use another DSN to connect to QuickBooks. But please wait for 15 to 30 seconds when you switch company files so that QODBC can have enough time to close one connection and open another one.

Use Connection String:

If you include ODBC connections into your codes, then create multiple DSNs may not be so effective. In this situation, you can use the DSNless connection string in your code to access company files more flexible.

Here is a sample DSNless connection string:

sConnectString = "Driver={QODBC Driver for QuickBooks};DFQ=C:\Program Files\QODBC Driver for QuickBooks\sample04.qbw;OpenMode=M;OLE DB Services=-2;"

This connection string will directly lead your application to QuickBooks company file without any DSNs. But please make sure this application has got the auto access certificate from the company file it is going to access.

If you are not familiar with the connection string, please refer to This Article for more information.

Using 64-bit Application to Access Multiple Company Files

When you try to use 64-bit applications to access multiple company files, you need bring QRemote into the connection. First please refer to the first method to create multiple QODBC DSNs with auto login certificate from different company files. Then you need to create multiple QRemote Client DSNs and setup them to point to the QODBC DSNs. Then you can use these QRemote DSNs to access different company files. Here is an introduction to show you how to create one QRemote DSN and setup it to point to one QODBC DSN.

First, please run QRemote Server via Windows Start->All Programs->QODBC for use with QuickBooks->Select "QRemote Server for QODBC" option.

Please note the IP and Port information. It will be useful in the later configuration.

Then select "Configure ODBC Data Source 64-bit" option in the same program group:

Go to "System DSN" tag and click "Add" button:

In "Create New Data Source" window, select "QRemote For QuickBooks" and click "Finish" to continue.

In the "DNS Configuration" window, input the DSN name at the option "Data Source Name". And input the IP and Port information you found in QRemote Server into the "Server" and "Port" option. Leave the "Encryption Key" option blank. After you input the correct IP and Port information, the "Remote DSN" option will list all available QOBDC DSNs in its menu. Select one which you want this QRemote DSN to point to. After the configuration, click "OK" button to finish.

Please keep QuickBooks running the company file you wish to access and log in as Admin in Single user mode when the first time you use this QRemote DSN. QuickBooks will also give an auto login certificate to it.

You can refer to This Article if you want to know more about QRemote.

Keywords: qb win log with multiple companies, log in with multiple companies

(0 vote(s))
Not helpful

Comments (2)
Teresa Thomas
19 November 2014 11:38 PM
So I have the multiple dsn's and am trying to access multiple qb files from excel. When i try to setup worksheets in the same workbook, each pointing to a different long as I do it manually i can refresh successfully. However, if i try to refresh all, it fails on the second one saying another quickbooks file is open. How can I have the workbook progress through each qb file?
24 November 2014 11:56 AM
Hi Teresa,

There is a limitation with the QuickBooks SDK that it can connect only 1 company file at a time on a machine. QODBC using QuickBooks SDK & thus you will able to open one company file at a time on a machine.

if you want to connect to another company file you need to disconnect the connection from your application and connect to another company file. So in your case refresh all will not work, you need to refresh worksheet one by one.
Post a new comment
Full Name:
CAPTCHA Verification 
Please complete the captcha below (we use this to prevent automated submissions).