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.
Getting Started
Installing the QuickBooks ODBC Driver
- Download the QuickBooks ODBC driver for your Windows platform. (Registration required.)
- 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.
The install program starts the Easysoft License Manager, because you cannot use the QuickBooks ODBC Driver until a license is obtained.
The following types of license are available:
- Free time-limited trial license which gives you free and unrestricted use of the product for a limited period (usually 14 days).
- Full license if you have purchased the product. On purchasing the product you are given an authorization code, which you use to obtain a license
- In Easysoft License Manager, enter your details.
You MUST enter the Name, E-Mail Address and Company fields.
The E-Mail Address MUST be the same as the address used to register and download from the Easysoft web site or you will be unable to obtain trial licenses.
- Choose Request License.
You are asked for a license type.
- Do one of the following:
- For a trial license click Time Limited Trial and then click Next.
The License Manager asks what software you are licensing. Select Easysoft QuickBooks ODBC Driver from the drop-down list and then click Next.
- If you have obtained an authorization code for a purchased license, select Non-expiring License and then click Next.
The License Manager requests your authorization code.
Enter the authorization code and then click Next.
- For a trial license click Time Limited Trial and then click Next.
- The License Manager displays a summary of the information you entered and allows you to choose the method of applying for your license.
- Do one of the following:
- Choose On-line Request if your machine is connected to the internet and can make outgoing connections to port 8884.
The License Manager then sends a request to the Easysoft license server to activate your license key automatically. This is the quickest method and results in your details being entered immediately into our support database.
- The remaining three options (Email Request, Print Request and View Request) are all ways to obtain a license if your machine is off-line (i.e. does not have a connection to the internet).
Each of these methods involves providing Easysoft with information including your machine number (a number unique to your machine) and then waiting to receive your license key.
Instead of emailing your details to Easysoft, you can enter them directly at the Easysoft web site and your license key will be emailed to you automatically.
To use this method, click View Request, and then visit:
In the Licensing page, enter your machine number (and authorization code for purchased license), click Submit and your license key will be emailed to you.
When you receive the license key, you can activate it either by double-clicking the email attachment or by clicking Enter License on the License Manager main screen and pasting the license key into the dialog box.
- Choose Finish to exit the License Manager.
The installation is complete.
- Choose On-line Request if your machine is connected to the internet and can make outgoing connections to port 8884.
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 (e.g. QuickBooks) and the ODBC driver that is required to connect to it (e.g. the QuickBooks ODBC driver).
You configure ODBC data sources in ODBC Administrator, which is included with Windows. To run ODBC Administrator, in the Windows Run dialog box, type:
%windir%\syswow64\odbcad32.exe
Use ODBC 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 front end.
- 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.
- Choose your ODBC data source from the Machine Data Source list, and then choose OK.
The Link Tables dialog box is displayed.
- Choose the table that you want to link and then choose OK.
- Choose the linked table in Microsoft Access, and then choose RETURN to work with the linked data.
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 / 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.
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 Oracle® HOME 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 a SID_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 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.
- 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 / 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 on the machine where you installed the QuickBooks ODBC Driver.
Install both the Client and Server. For information on installing, licensing and testing the , refer to the documentation.
- Open the 64-bit ODBC Administrator, which is either the only version of this application that's accessible via 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, type 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.
Linked Server
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, type "QUICKBOOKS".
- From the Provider list, choose Microsoft OLE DB Provider for ODBC Drivers.
- In the Data source box, type 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 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.
- 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.