简体   繁体   English

使用PHP连接到Peachtree数据库?

[英]Connecting to Peachtree database using php?

Iam developing an application in php which can fetch transaction,invoices.etc from peachtree database. 我在php中开发了一个应用程序,可以从peachtree数据库中获取交易,发票等。 So for database access I selected ODBC method by connecting using Pervasive SQL. 因此,对于数据库访问,我通过使用Pervasive SQL连接选择了ODBC方法。 I used connection string like this:- 我使用了这样的连接字符串:

$connection = odbc_connect("DRIVER={Pervasive ODBC Engine Interface};Dbq=C:\Sagepro\Peachtree\Company\Sample\PAW\BCS","Peachtree","password");

But it is giving error 但这给了错误

 ( ! ) Warning: odbc_connect() [function.odbc-connect]: SQL error: [Pervasive][ODBC Client Interface][LNA][Pervasive][ODBC Engine Interface][Data Record Manager]Cannot locate the named database you specified(Btrieve Error 2301), SQL state S1000 in SQLConnect in C:\wamp\www\peachtreeapi\index.php on line 2

How to rectify this?? 如何纠正这一点?

使用此连接字符串..它将起作用

 $connect=odbc_connect("Driver={Pervasive ODBC Engine Interface};ServerName=localhost;ServerDSN=DSNname;","Username","Password",SQL_CUR_USE_ODBC);  

I think this connection string will work:- 我认为此连接字符串将起作用:

 $dbhandle = odbc_connect("DSN=YOURDSN;DRIVER={Pervasive ODBC Engine Interface};DATAPATH=c:\peachw\YOURCOMPANY;DDFPATH=c:\peachw\YOURCOMPANY","username","password");

username & password is the details you provided in peachtree -> maintain->users->setupsecurity->data access/crystalreport ->All option in your peachtree app. 用户名和密码是您在peachtree应用程序中的peachtree->维护->用户-> setupsecurity->数据访问/ crystalreport-> All选项中提供的详细信息。

You'll need to create a Pervasive Database Name pointing to your data location. 您需要创建一个指向您的数据位置的普及数据库名称。 You can't specify a path in the connection string. 您不能在连接字符串中指定路径。 Pervasive removed that functionality. 普遍删除了该功能。 Once you create the Database Name through the Pervasive Control Center, you would specify that name in your connection string: 通过“普及控制中心”创建数据库名称后,您将在连接字符串中指定该名称:

$connection = odbc_connect("DRIVER={Pervasive ODBC Engine Interface};Dbq=XXXXXXXX","Peachtree","password");

where "XXXXXXXX" is the name of the database you created in the PErvasive Control Center. 其中“ XXXXXXXX”是您在PErvasive Control Center中创建的数据库的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM