Knowledgebase: Connection
[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

Introduction:

When multiple QuickBooks company files are located on one machine, how do we use only one copy of QODBC to access those company files? Please note that QODBC can only access one company file on one device simultaneously. So it is impossible to use QODBC to access multiple company files locally at one time. But we can set up QODBC to access these company files one by one.

Setup Multiple DSN:

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

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

When your application is 32-bit:

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

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

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

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

Please press the "F2" key in QuickBooks UI if you cannot find the company store path. You will find the correct store path in the "Product Information" window.

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

After assigning each company files one DSN, you can use these DSNs to access company files. When you want to access another company file, release the connection of the 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.

Use Connection String:

If you include ODBC connections in your codes, creating multiple DSNs may be ineffective. In this situation, you can use the DSN-less connection string in your code to access company files more flexibly.

Here is a sample DSN-less 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 the QuickBooks company file without any DSNs. But please make sure this application has the auto access certificate from the company file it will access.

If you are unfamiliar 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 to bring QRemote into the connection. First, please refer to the first method to create multiple QODBC DSNs with auto login certificates from different company files. Then it would be best if you created multiple QRemote Client DSNs and set them up to a 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 set it up to a point to one QODBC DSN.

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

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

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

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

In the "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 "Data Source Name" option. And input the IP and Port information you found in QRemote Server into the "Server" and "Port" options. Leave the "Encryption Key" with the default key("QODBC#QRemote$1"). After you input the correct IP and Port information, the "Remote DSN" option will list all available QOBDC DSNs in its menu. Select one to which you want this QRemote DSN to point. After the configuration, click the "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))
Helpful
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 DSN..as 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?
Jack
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:
Email:
Comments:
CAPTCHA Verification 
 
Please complete the captcha below (we use this to prevent automated submissions).