Connect to QuickBooks Online from Oracle
The QuickBooks Online ODBC driver enables you to work with QuickBooks Online data in Oracle just as if you were working with data stored in a Oracle table.
Download the QuickBooks Online ODBC driver. Then follow the instructions in this article to install and license the driver and set up the ODBC data source that enables you to connect Oracle to QuickBooks online.
The following instructions show you how to connect Oracle on Windows to QuickBooks Online. For further information about DG4ODBC, refer to our DG4ODBC for Windows tutorial.
- Create a DG4ODBC init file on your Oracle machine. To do this, change to the
%ORACLE_HOME%\hs\admindirectory. Create a copy of the fileinitdg4odbc.ora. Name the new fileinitquickbooksol.ora.Note In these instructions, replace
%ORACLE_HOME%with the location of your OracleHOMEdirectory. 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_online_odbc_dsn
Replace
my_quickbooks_online_odbc_dsnwith the name of a QuickBooks ODBC driver data source that connects to the target QuickBooks server. For exampleHS_FDS_CONNECT_INFO = "QuickBooksOnlineSystemDSN"
- 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.orathat creates a SID_NAME for DG4ODBC. For example:SID_LIST_LISTENER = (SID_LIST = (SID_DESC= (SID_NAME=quickbooksol) (ORACLE_HOME=%ORACLE_HOME%) (PROGRAM=dg4odbc) ) ) - Add a DG4ODBC entry to
%ORACLE_HOME%\network\admin\tnsnames.orathat specifies theSID_NAMEcreated in the previous step. For example:QUICKBOOKSOL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = oracle_host)(PORT = 1521)) (CONNECT_DATA = (SID = quickbooksol) ) (HS = OK) )Replace
oracle_hostwith 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 quickbooksollink CONNECT TO "dummyuser" IDENTIFIED BY "password" USING 'quickbooksol'; - Try querying your QuickBooks data. For example:
SELECT * FROM "PurchaseOrder"@QUICKBOOKSOLLINK;
Notes
- If you have problems connecting to QuickBooks from Oracle, enable DG4ODBC tracing and check the trace files written to the
%ORACLE_HOME%\hs\tracedirectory. To enable DG4ODBC tracing, add the lineHS_FDS_TRACE_LEVEL = DEBUGtoinitquickbooks.oraand then start or restart the Oracle listener. If thetracedirectory 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
TEMPdirectory. For example,C:\Windows\Temp\SQL.log.