connecting to quickbooks database via odbc with php?

纵然是瞬间 提交于 2019-12-21 02:58:31

问题


[edit]
We're collecting credit application data from users on a web form.

I have not tied my web form directly into QB.

I have no idea what the QB table structure is for this collection of data - nor of how it displays it to the user because I've never actually worked directly with QB. Others in my office do however.


I would still appreciate any information about open source / free options.


I'll simplify the problem by removing the first desired option.

Let's just talk about importing a flat file into quickbooks.

I don't have a copy of quickbooks that I can play with, so I have no idea what options exist that are native to quickbooks but I see some chatter on the web about QB expecting an .ini file for imports. (don't know the format that it expects yet, but I'll get that worked out later)

Please share your story if you have managed to import a flat file from mySQL into quickbooks or know of links that offer insight (I'm not finding much right now).
[end edit]

I realize that this scenario is probably uncommon, but I need to connect to an existing quickbooks database in one of two ways.

1) either directly from a php script running on our web site -- insert user supplied data directly from web to quickbooks.

or

2) put user's data directly into mySQL database and later export data from mySQL to quickbooks.

If the first option is viable, I would appreciate your thoughts on establishing an odbc connection to the quickbooks database.

can I go about it with something like:

try {
  $conn = @odbc_connect("DSNName", "", "", "SQL_CUR_USE_ODBC");
  // un and pw parameters are passed as empty strings since the DSN 
  // has knowledge of the password already.
  // 4th parameter is optional

  $exec = @odbc_exec($conn, $insert) or die ("exec error");
  echo "success!";
}
catch (Exception $e) {
  echo $e->getMessage();
} // end try catch

回答1:


The third option might work for you.

Option 1 - QODBC: If you're looking for simplicity, Qodbc as mentioned above is the main product that does it, and it does cost money.

Option 2 - Quickbooks SDK: If you're okay working through the SDK and using their XML structures, you can find some great resources on the developer network. Accounts are free for the SDK and you can work your way through it fairly easily.

This boils down to one thing, if you want it free, you might not be able to get it your way.. QODBC is reasonably priced the last time I checked.

The one thing that is important to be aware of with either approach -- ensure the tables you wish to write data into in Quickbooks are available by the SDK and QODBC.

As Quickbooks has gotten older, access to some tables have disappeared. For example, it's not possible to write directly to the payroll deductions table directly as it competes with Intuit's Payroll Service.

Option 3 - Direct SQL manipulation: Intuit encrypts their data in their SQL data making it unavailable for direct access.

Edit: Option 4 - Quickbooks Web Connector SOAP wrapper that sits on the computer with Quickbooks and interacts with it for you. Also free.

Good luck!




回答2:


If you want ODBC access, QODBC is your only choice.

The newer versions of QuickBooks Enterprise Edition use an SQL database back-end, but it does not allow you to directly access the SQL tables. They lock the database down so you can't actually query any of the data.

AccessBooks is another option, which mirrors data from QuickBooks into MySQL, and then can push data back to QuickBooks as well. I have heard that it can be a bit flaky.

You can use the QuickBooks SDK and make it do pretty much anything you can do in the QuickBooks GUI, but it's a bit more work. If you're integrating a web application with QuickBooks, you'll want to use the Web Connector. I'm the developer of a QuickBooks/PHP framework which is quite stable and popular, and would probably be helpful to you:

https://idnforums.intuit.com/messageview.aspx?catid=56&threadid=9164

I'm in the middle of adding support for mirroring the entire QB schema to a database, keeping it in sync, and then allowing changes to be pushed back to QuickBooks. The work isn't near complete yet though. It currently pulls data from QuickBooks and keeps it in sync remarkably well however.

You can also import IIF files into QuickBooks, but it's now an unsupported and deprecated format by Intuit. They highly recommend you do not use it, here are some reasons why: http://wiki.consolibyte.com/wiki/doku.php/quickbooks_integration_methods




回答3:


You may have already seen this but if you haven't you will want to take a look as it seems to provide the requirements, setup instructions, and sample code for your first scenario.

http://www.qodbc.com/QODBCweb.htm




回答4:


Not sure exactly what the import is to accomplish: what sort of transactions are you pushing into quickbooks?

I've had great success with using the QuickBooks SDK to push data into quickbooks, especially transactions data so that things like reconciliations, posting, etc are handled by quickbooks itself. Is this an option available to you?

You can get a lot of information on the SDK here




回答5:


With QuickBooks Enterprise 2011 this changed, and you can have real ODBC access (although with limited rights and to a limited amount of tables) and then use an SQL tool to map via the ODBC access.



来源:https://stackoverflow.com/questions/608117/connecting-to-quickbooks-database-via-odbc-with-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!