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

  1. Download the QuickBooks ODBC driver for your Windows platform.
  2. 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:

  1. Choose the System DSN tab, and then choose Add.
  2. In the Create New Data Source dialog box, choose Easysoft ODBC-QuickBooks Desktop Driver, and then choose Finish.
  3. 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 to US.

Allow the QuickBooks ODBC driver to access QuickBooks

  1. Start QuickBooks Desktop if it is not already running.
  2. In your application, connect to your newly QuickBooks data source.
  3. 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.

  4. Choose Yes.

    The Access Confirmation dialog box is displayed.

  5. 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.

  1. Open your Microsoft Access database.
  2. 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.

  3. 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:

  1. 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.

  2. In the Choose Data Source dialog box, choose your QuickBooks ODBC driver data source from the list, and then choose OK.
  3. In the Query Wizard, choose the columns that contain the data you want to retrieve, and then click Next.
  4. 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.
  5. 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.
  6. On the File menu, choose Return data to Excel.
  7. 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.

  1. In your QuickBooks ODBC driver data source, enable Application is a Service.
  2. Create a DG4ODBC init file. To do this, change to the %ORACLE_HOME%\hs\admin directory. Create a copy of the file initdg4odbc.ora. Name the new file initquickbooks.ora.

    Note In these instructions, replace %ORACLE_HOME% with the location of your Oracle HOME directory. For example, C:\oraclexe\app\oracle\product\11.2.0\server.

  3. 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"
  4. Comment out the line that enables DG4ODBC tracing. For example:
    #HS_FDS_TRACE_LEVEL = <trace_level>
  5. Add an entry to %ORACLE_HOME%\network\admin\listener.ora that creates a SID_NAME for DG4ODBC. For example:
    SID_LIST_LISTENER =
     (SID_LIST =
       (SID_DESC=
         (SID_NAME=quickbooks)
         (ORACLE_HOME=%ORACLE_HOME%)
         (PROGRAM=dg4odbc)
       )
     )
  6. Add a DG4ODBC entry to %ORACLE_HOME%\network\admin\tnsnames.ora that specifies the SID_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.

  7. Start (or restart) the Oracle Listener:
    cd %ORACLE_HOME%\bin
    lsnrctl stop
    lsnrctl start
  8. Connect to your Oracle database in SQL*Plus.
  9. 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';
  10. Try querying your QuickBooks data. For example:
    SELECT * FROM "PurchaseOrder"@QUICKBOOKSLINK;

Notes

Connecting SQL Server to QuickBooks

  1. 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.

  2. 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.
  3. Choose the System DSN tab, and then choose Add.

    The ODBC-ODBC Bridge DSN dialog box is displayed

  4. In the Name box, enter "OOBQuickBooks". Choose the Server tab.
  5. In the Servers box, enter "localhost:8888".
  6. In the Username and Password boxes, enter your Windows user name and password for this machine. Choose the Target DSN tab.
  7. In the TargetDSN box, enter the name of your QuickBooks ODBC driver data source.

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:

  1. 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.

  2. Right-click Server Objects. From the pop-up menu choose New > Linked Server.
  3. In the Linked server box, enter "QUICKBOOKS".
  4. From the Provider list, choose Microsoft OLE DB Provider for ODBC Drivers.
  5. 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.)
  6. Choose the Security page.
  7. Choose Be made using this security context.
  8. 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 System PATH. 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.
  9. 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.