QuickBooks ODBC driver
The QuickBooks ODBC driver enables you to work with QuickBooks Desktop data outside of the QuickBooks interface. The driver allows you to use QuickBooks data in any application that supports ODBC. For example, Microsoft Access, Excel, SQL Server, Oracle, PHP, and Perl. You can query QuickBooks as well as adding and updating QuickBooks records.
Installing the QuickBooks ODBC driver
- Download the QuickBooks ODBC driver for your Windows platform.
- Install and license the QuickBooks ODBC driver on the machine where your client application is installed.
For example, if you want to analyse QuickBooks data in Excel, install the QuickBooks ODBC driver on the machine where Excel is installed.
To do this, execute the file distribution that you downloaded in the previous step, and follow the on screen instructions.
Configuring an ODBC data source
Before you can use the QuickBooks ODBC driver to connect your application to QuickBooks, you need to configure an ODBC data source. An ODBC data source stores the connection details for the target database (in this case, QuickBooks) and the ODBC driver that is required to connect to it (in this case, the QuickBooks ODBC driver).
You configure ODBC data sources in ODBC Data Source Administrator, which is included with Windows. To run ODBC Data Source Administrator, in the Windows Run dialog box, type:
%windir%\syswow64\odbcad32.exe
Use ODBC Data Source Administrator to create a QuickBooks ODBC driver data source:
- Choose the System DSN tab, and then choose Add.
- In the Create New Data Source dialog box, choose Easysoft ODBC-QuickBooks Desktop Driver, and then choose Finish.
- Complete these fields Easysoft ODBC-QuickBooks Desktop Driver DSN Setup dialog box:
Setting Value DSN QuickBooks Desktop
Connection Mode Same As QuickBooks
Application Name EasysoftQuickBooksODBC
Application ID EasysoftQuickBooksODBC
QB Edition Set this to be the same as QuickBooks Desktop. For example, if you have the US version of QuickBooks, set QB Edition
toUS
.
Allow the QuickBooks ODBC driver to access QuickBooks
- Start QuickBooks Desktop if it is not already running.
- In your application, connect to your newly QuickBooks data source.
- When you first connect, QuickBooks prompts you to whether to allow the QuickBooks ODBC driver to access your QuickBooks data. In the QuickBooks - Application with No Certificate dialog box, choose "Yes, always allow access even if QuickBooks is not running." Choose "Allow this application to access personal data such as Social Security Numbers and customer credit card information." Choose Continue.
The Confirm to Proceed dialog box is displayed.
- Choose Yes.
The Access Confirmation dialog box is displayed.
- In your application, try a sample query. For example:
select top 10 * from vendor
Connecting your application to QuickBooks
64-bit applications
QuickBooks Desktop is a 32-bit application, which can only be used with 32-bit libraries. The QuickBooks Desktop ODBC driver is a library and is therefore 32-bit as well. If you want to use the QuickBooks Desktop ODBC driver to connect a 64-bit application to QuickBooks, you also need to install the Easysoft ODBC-ODBC Bridge and enable the Application is a Service attribute in your ODBC data source. The SQL Server how to provides an example of this process. The other examples in this section are for 32-bit versions of the application. If you have the 64-bit version of, say, Excel or Oracle, refer to the SQL Server example for the other steps you need to do.
Microsoft Access
Microsoft Access uses an ODBC driver to interact with an external data source. ODBC is a data access technology, the Microsoft implementation of which is included with Windows. You can use the QuickBooks ODBC driver to connect Microsoft Access to a QuickBooks database, enabling you to retrieve and update QuickBooks data from a Microsoft Access frontend.
- Open your Microsoft Access database.
- Do one of the following:
- For Microsoft Access 2003 and earlier, on the File menu, choose Get External Data > Link Tables.
The Link dialog box is displayed.
- For Microsoft Access 2007, on the External Data tab, choose More > ODBC Database.
The Get External Data wizard starts.
- For Microsoft Access 2010 and later, on the External Data tab, choose ODBC Database.
The Get External Data wizard starts.
- For Microsoft Access 2003 and earlier, on the File menu, choose Get External Data > Link Tables.
- Do one of the following:
- For Microsoft Access 2003 and earlier, choose ODBC Databases from the Files of type list.
- For Microsoft Access 2007 and later, choose Link to the data source by creating a linked table, and then choose OK.
The Select Data Source dialog box is displayed.
Connecting Excel to QuickBooks
Follow these steps to return data from QuickBooks to Microsoft Excel by using Microsoft Query:
- Do one of the following:
- For Excel 2007 and later, on the Data tab, choose Get External Data. In the From Other Sources group, choose From Microsoft Query.
- For Excel 2003 and earlier, on the Data menu, choose Import External Data, and then choose New Database Query.
The New Database Query command uses Microsoft Query to import data. Microsoft Query is an optional feature, which by default is not installed. If you do not have Microsoft Query installed, choosing New Database Query will prompt you to install it. To do this, in Control Panel, choose Programs and Features (or Add or Remove Programs). Choose Microsoft Office (if you installed Excel as part of Office) or Microsoft Excel, and then choose Change. Follow the instructions on screen. Select Choose advanced customization of applications during the Setup wizard if this option is present for your version of Office or Excel. Microsoft Query is located under Office Tools.
When you have installed Microsoft Query, repeat step 1.
- In the Choose Data Source dialog box, choose your QuickBooks ODBC driver data source from the list, and then choose OK.
- In the Query Wizard, choose the columns that contain the data you want to retrieve, and then click Next.
- If you want to return a subset of the data, use the Filter Data screen to filter the results of your query (this is the equivalent of a SQL
WHERE
clause), and then click Next. - If you want to change the sort order of your data, use the Sort Order screen to sort the results of your query (this is the equivalent of a SQL
ORDER BY
clause), and then click Next. - On the File menu, choose Return data to Excel.
- Choose a location for the data on your worksheet when prompted.
Note If nothing appears to happen at this final stage, the target table has more columns than can be retrieved in one Microsoft Query session. Microsoft Query will be running in the background. Switch to Query and reduce the number of columns to retrieve. Repeat the above steps to retrieve the additional columns. (In other words, you may need to split the table over multiple Query sessions to retrieve all the data it contains.)
Connecting Oracle to QuickBooks
The following instructions show you how to connect Oracle on Windows to QuickBooks. For further information about DG4ODBC, refer to our DG4ODBC for Windows tutorial.
- In your QuickBooks ODBC driver data source, enable Application is a Service.
- Create a DG4ODBC init file. To do this, change to the
%ORACLE_HOME%\hs\admin
directory. Create a copy of the fileinitdg4odbc.ora
. Name the new fileinitquickbooks.ora
.Note In these instructions, replace
%ORACLE_HOME%
with the location of your OracleHOME
directory. For example,C:\oraclexe\app\oracle\product\11.2.0\server
. - Ensure these parameters and values are present in your init file:
HS_FDS_CONNECT_INFO = my_quickbooks_odbc_dsn
Replace
my_quickbooks_odbc_dsn
with the name of a QuickBooks ODBC driver data source that connects to the target QuickBooks server. For example:HS_FDS_CONNECT_INFO = "32-bit QuickBooks System"
- Comment out the line that enables DG4ODBC tracing. For example:
#HS_FDS_TRACE_LEVEL = <trace_level>
- Add an entry to
%ORACLE_HOME%\network\admin\listener.ora
that creates aSID_NAME
for DG4ODBC. For example:SID_LIST_LISTENER = (SID_LIST = (SID_DESC= (SID_NAME=quickbooks) (ORACLE_HOME=%ORACLE_HOME%) (PROGRAM=dg4odbc) ) )
- Add a DG4ODBC entry to
%ORACLE_HOME%\network\admin\tnsnames.ora
that specifies theSID_NAME
created in the previous step. For example:QUICKBOOKS = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle_host)(PORT = 1521)) (CONNECT_DATA = (SID = quickbooks) ) (HS = OK) )
Replace
oracle_host
with the host name of your Oracle machine. - Start (or restart) the Oracle Listener:
cd %ORACLE_HOME%\bin lsnrctl stop lsnrctl start
- Connect to your Oracle database in SQL*Plus.
- In SQL*Plus, create a database link for the target QuickBooks server. For example:
CREATE PUBLIC DATABASE LINK quickbookslink CONNECT TO "dummyuser" IDENTIFIED BY "password" USING 'quickbooks';
- Try querying your QuickBooks data. For example:
SELECT * FROM "PurchaseOrder"@QUICKBOOKSLINK;
Notes
- If you have problems connecting to QuickBooks from Oracle, enable DG4ODBC tracing and check the trace files written to the
%ORACLE_HOME%\hs\trace
directory. To enable DG4ODBC tracing, add the lineHS_FDS_TRACE_LEVEL = DEBUG
toinitquickbooks.ora
and then start or restart the Oracle listener. If thetrace
directory does not exist, create it. - If you enable ODBC Driver Manager tracing, but do not get a trace file or get an empty trace file, change the trace file location to the Windows
TEMP
directory. For example,C:\Windows\Temp\SQL.log
.
Connecting SQL Server to QuickBooks
- Install the ODBC-ODBC Bridge on the machine where you installed the QuickBooks ODBC driver.
Install both the client and server. For information on installing, licensing, and testing the ODBC-ODBC Bridge, refer to the documentation.
- Open the 64-bit ODBC Data Source Administrator, which is either the only version of this application that's accessible by using Control Panel > Administrative Tools or if there are two, it will contain 64-bit in its name.
- Choose the System DSN tab, and then choose Add.
The ODBC-ODBC Bridge DSN dialog box is displayed
- In the Name box, enter "OOBQuickBooks". Choose the Server tab.
- In the Servers box, enter "localhost:8888".
- In the Username and Password boxes, enter your Windows user name and password for this machine. Choose the Target DSN tab.
- In the TargetDSN box, enter the name of your QuickBooks ODBC driver data source.
- In your QuickBooks ODBC driver data source, enable Application is a Service.
These steps show you how to use a linked server to work with QuickBooks data, just as if you were working with data stored in a SQL Server table:
- In Microsoft SQL Server Management Studio, connect to the SQL Server instance you want to create the linked server against.
You need to log on with an account that is a member of the SQL Server
sysadmin
fixed server role to create a linked server. - Right-click Server Objects. From the pop-up menu choose New > Linked Server.
- In the Linked server box, enter "QUICKBOOKS".
- From the Provider list, choose Microsoft OLE DB Provider for ODBC Drivers.
- In the Data source box, enter the name of your data source, and then choose OK. (If you have not yet configured an data source, refer to these instructions. You need to use the for this reason.)
- Choose the Security page.
- Choose Be made using this security context.
- Type your QuickBooks user name and password in the spaces provided. Choose OK.
SQL Server verifies the linked server by testing the connection.
- If you get the error "Specified driver could not be loaded due to system error 126: The specified module could not be found," choose Yes when prompted whether to keep the linked server. You need to restart your SQL Server instance before you can use the linked server. If SQL Server was already running when you installed the Easysoft ODBC drivers, it will not have the latest version of the System
PATH
environment variable. The Easysoft ODBC driver Setup program adds entries for the driver to the SystemPATH
. Restarting the instance makes these changes available to SQL Server, allowing it to load the QuickBooks ODBC driver. - If you made a mistake when specifying the data source, you get the error "Data source name not found and no default driver specified." If you get this error, choose No when prompted whether to keep the linked server and edit the value in the Data source box.
- If you get the error "Specified driver could not be loaded due to system error 126: The specified module could not be found," choose Yes when prompted whether to keep the linked server. You need to restart your SQL Server instance before you can use the linked server. If SQL Server was already running when you installed the Easysoft ODBC drivers, it will not have the latest version of the System
- You can query your QuickBooks data either by using a:
- Four-part table name in a distributed query.
A four-part table name has the format:
server_name.[database_name].[schema_name].table_name.
For QuickBooks you need to omit the database name and schema. For example:
SELECT * from QUICKBOOKS...vendor
- Pass-through query in an
OPENQUERY
function. For example:SELECT * FROM OPENQUERY(QUICKBOOKS, 'SELECT * FROM vendor')
SQL Server sends pass-through queries as uninterpreted query strings to the QuickBooks ODBC driver. This means that SQL Server does not apply any kind of logic to the query or try to estimate what that query will do.
- Four-part table name in a distributed query.