php 使用php通过odbc连接到quickbooks数据库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/608117/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-24 23:15:12  来源:igfitidea点击:

connecting to quickbooks database via odbc with php?

phpmysqlodbcquickbooks

提问by m42

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

[编辑]
我们正在通过网络表单从用户那里收集信用申请数据。

I have not tied my web form directly into QB.

我没有将我的网络表单直接绑定到 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.

我不知道这个数据集合的 QB 表结构是什么——也不知道它如何向用户显示它,因为我从来没有直接使用 QB。然而,我办公室的其他人却这样做了。



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.

我们只讨论将平面文件导入到 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)

我没有可以玩的 quickbooks 副本,所以我不知道存在哪些quickbooks 固有的选项,但我在网上看到一些关于 QB 期望导入 .ini 文件的喋喋不休。(不知道它期望的格式,但我稍后会解决)

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]

如果您已经成功地将平面文件从 mySQL 导入到 Quickbooks 或知道提供洞察力的链接(我现在没有找到太多),请分享您的故事。
[结束编辑]

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

我意识到这种情况可能并不常见,但我需要以两种方式之一连接到现有的 quickbooks 数据库。

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

1) 或者直接从我们网站上运行的 php 脚本——将用户提供的数据直接从 web 插入到 quickbooks。

or

或者

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

2) 将用户的数据直接放入mySQL 数据库,然后将数据从mySQL 导出到quickbooks。

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

如果第一个选项可行,我会很感激您对建立与 quickbooks 数据库的 odbc 连接的想法。

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

采纳答案by Jas Panesar

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.

选项 1 - QODBC:如果您正在寻找简单性,上面提到的 Qodbc 是主要的产品,而且它确实要花钱。

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.

选项 2 - Quickbooks SDK:如果您可以使用 SDK 并使用它们的 XML 结构,那么您可以在开发人员网络上找到一些很好的资源。SDK 的帐户是免费的,您可以相当轻松地完成它。

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.

这归结为一件事,如果您想要免费,您可能无法按照自己的方式获得。我上次检查时 QODBC 的价格合理。

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.

使用任何一种方法都需要注意的一件事很重要——确保您希望在 Quickbooks 中写入数据的表可通过 SDK 和 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.

随着 Quickbooks 变老,对某些表格的访问已经消失。例如,无法直接写入工资扣除表,因为它与 Intuit 的工资服务竞争。

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

选项 3 - 直接 SQL 操作:Intuit 将其 SQL 数据中的数据加密,使其无法直接访问。

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

编辑:选项 4 - Quickbooks Web 连接器SOAP 包装器,它位于带有 Quickbooks 的计算机上并为您与之交互。也是免费的。

Good luck!

祝你好运!

回答by Keith Palmer Jr.

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

如果您想要 ODBC 访问,QODBC 是您唯一的选择。

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

QuickBooks的企业版的新版本使用SQL数据库后端,但它并没有让你直接访问SQL表。它们锁定了数据库,因此您实际上无法查询任何数据。

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.

AccessBooks 是另一种选择,它将数据从 QuickBooks 镜像到 MySQL,然后也可以将数据推送回 QuickBooks。我听说它可能有点片状。

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:

您可以使用 QuickBooks SDK 并让它做几乎所有您可以在 QuickBooks GUI 中做的事情,但这需要做更多的工作。如果您将 Web 应用程序与 QuickBooks 集成,您将需要使用 Web 连接器。我是 QuickBooks/PHP 框架的开发人员,该框架非常稳定且流行,可能对您有所帮助:

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

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.

我正在添加对将整个 QB 架构镜像到数据库的支持,使其保持同步,然后允许将更改推送回 QuickBooks。不过这项工作还没有接近完成。然而,它目前从 QuickBooks 中提取数据并保持同步。

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

您还可以将 IIF 文件导入 QuickBooks,但它现在是 Intuit 不支持和弃用的格式。他们强烈建议您不要使用它,原因如下:http: //wiki.consolibyte.com/wiki/doku.php/quickbooks_integration_methods

回答by Yishai

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.

使用 QuickBooks Enterprise 2011,这种情况发生了变化,您可以拥有真正的 ODBC 访问权限(尽管权限有限且表数量有限),然后使用 SQL 工具通过 ODBC 访问进行映射。

回答by cOle2

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

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

回答by Rad

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?

我在使用 QuickBooks SDK 将数据推送到 Quickbooks 方面取得了巨大成功,尤其是交易数据,以便对帐、发布等内容由 quickbooks 本身处理。您可以选择此选项吗?

You can get a lot of information on the SDKhere

您可以此处获取有关 SDK的大量信息