在Windows上使用PHP连接到Advantage数据库 [英] Connecting to an Advantage Database with PHP on Windows

查看:114
本文介绍了在Windows上使用PHP连接到Advantage数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个客户,该客户的应用程序使用Advantage Database. 我在尝试使用ODBC或PHP连接器与PHP连接时遇到问题 它会发现此6420错误,这似乎很常见.

I have a customer that has an application that uses an Advantage Database. I am having problems trying to connect to it with PHP using ODBC or the PHP connector it get this discovery 6420 error which seems quite common.

我认为大多数问题是我对优势数据库缺乏了解. 我认为问题可能出在实际上没有服务器在运行吗? 该应用程序可能具有自己的服务器类型吗? 我编写了一个小的C#程序,该程序连接到数据字典并可以正常读取,但对于C#,它使用此Advantage.data.provider.那像服务器吗?

I think most of the problem is my laack of understanding of the Advantage Database. I am thinking the problem may be there is actually no server running? do that application maybe have its own kind of server maybe? I have written a small C# program that connects to the data dictionary and reads it fine, but it uses this Advantage.data.provider for C#. Is that acting like a server?

所以我想最重要的是: 有没有一种方法可以连接到此数据字典/Advantage数据库,这样我就可以使用PHP进行访问了? (最好不要买东西)

So I guess the bottom line is: Is there a way to connect to this data dictionary/Advantage Database so I can access with PHP? (preferably without buying something)

感谢您的帮助.

推荐答案

注意:我与Advantage或Sybase(拥有Advantage的母公司)没有关系.我以前经常与Advantage合作,并且有一些经验,但是与公司或产品没有任何关系.

NOTE: I have no affiliation with Advantage or Sybase (the parent company which owns Advantage); I used to work with Advantage regularly and have some experience, but in no way am associated with the company or product.

优势数据库服务器(ADS)以三种不同的模式运行.默认情况下,它在服务器模式下运行(ADS_REMOTE_SERVER),这要求运行Advantage数据库服务器实例,可以通过检查特定端口(该端口是可配置的)来找到该实例.

Advantage Database Server (ADS) runs in three different modes. By default, it runs in server mode(ADS_REMOTE_SERVER), which requires an Advantage Database Server instance be running that can be found by checking at a specific port (the port is configurable).

第二个默认模式是ADS_AIS_SERVER,这是Advantage Internet Server.这允许远程连接通过Internet连接直接连接到AIS实例.我从未使用过此版本的ADS,因此无法对此模式发表评论.

The second default mode is ADS_AIS_SERVER, which is the Advantage Internet Server. This allows remote connections to connect directly to an AIS instance via an internet connection; I've never used this version of ADS, so I can't comment on that mode.

最终模式是本地服务器(未配置为默认连接类型),在这种情况下,将加载Advantage DLL的本地副本,并使用该本地连接运行以访问数据.在这种模式下,某些功能不可用(例如事务),并且连接数受到限制. Advantage Local Server免费提供给本地使用,最多支持5个连接(无论如何,我上次检查过).

The final mode is Local Server (not configured as a default connection type), in which case a local copy of the Advantage DLL is loaded and it runs using that local connection to access the data. In this mode, certain functionality is not available (transactions, for instance), and the number of connections is limited. Advantage Local Server is free for local use, and supports up to 5 connections (last I checked, anyway).

ADS具有多种连接方式(ODBC,.NET数据提供程序,C,C#,Clipper,FoxPro以及其他几个库),并且在服务器和客户端级别上都支持Windows和Linux.

ADS has several ways to connect (ODBC, a .NET Data Provider, libraries for C, C#, Clipper, FoxPro, and a couple others), and supports both Windows and Linux on both the server and client level.

该模式通常通过API调用进行配置;我对通过Delphi组件实现使用ADS更为熟悉.通过API,ADSSetServerType决定使用哪种模式(或模式组合).

The mode is typically configured by an API call; I'm more familiar with using ADS through it's Delphi component implementation; via the API, it's ADSSetServerType that determines which mode is used (or combination of modes).

对于ODBC,您可以通过ODBC配置屏幕(在Windows控制面板中使用普通的ODBC管理实用程序时可见)配置模式-请参见下图中的可用服务器类型"分组框:

For ODBC, you configure the mode via the ODBC Configuration Screen (visible when using the normal ODBC administration utility in Windows Control Panel) - see the Available Server Types groupbox in the image below:

根据文档,您认为它是发现错误是正确的.您是否已查看建议的解决方案?

According to the documentation, you're correct about it being a discovery error. Have you checked the suggested solutions?

问题:Advantage应用程序无法连接到Advantage Database Server.

Problem: The Advantage application was unable to connect to the Advantage Database Server.

解决方案:几个问题可能导致此错误发生.下面列出了一些常见的解决方案.请参考Advantage知识库,以获取更详细的描述和已知错误情况的更完整列表.

Solution: Several problems can cause this error to occur. Some common solutions are listed below. Reference the Advantage Knowledge Base for more detailed descriptions and a more complete list of known error cases.

  • 验证Advantage Database Server已在数据库所在的服务器上安装并运行.

  • Verify the Advantage Database Server is installed and running on the server where the database is located.

如果尝试使用Advantage Local Server而不是Advantage Database Server,请确保将应用程序的服务器类型"设置设置为使用Advantage Local Server.

If attempting to use the Advantage Local Server and not the Advantage Database Server, make sure the application's "server types" setting is set to use the Advantage Local Server.

如果在Advantage Data Architect中使用本机SQL实用程序,并且您希望使用Advantage Local Server而不是Advantage Database Server,请确保将Advantage连接类型设置为本地(ALS)".这可以通过单击查询选项"对话框来完成,方法是单击带有螺丝起子,锤子和扳手的按钮,然后单击该对话框.

If using the Native SQL Utility in the Advantage Data Architect, and you desire to use the Advantage Local Server and not the Advantage Database Server, make sure the Advantage connection type is set to "Local (ALS)". This can be done via the Query Options dialog that is accessed by clicking the button that has the screwdriver, hammer, and wrench on it.

如果服务器是NetWare 5或更高版本,请确保Advantage Database Server的版本是5.6或更高版本,并确保Advantage客户端是v2.6或更高版本.

If the server is NetWare 5 or greater, make sure the version of the Advantage Database Server is 5.6 or greater, and make sure the Advantage client is v2.6 or greater.

如果要与仅安装IPX的服务器通信,请确保启用了Advantage客户端发送IPX数据包.

If communicating to a server that only has IPX installed, make sure the Advantage client is enabled to send IPX packets.

如果通过防火墙运行,请确保正确配置Advantage IP发送和接收端口并通过防火墙打开.

If running through a firewall, make sure the Advantage IP send and receive ports are properly configured and opened up through the firewall.

(我本打算在Sybase网站上提供指向文档的链接,但是现在看来离线维护;我明天将在备份时更新此答案或可以访问带有书签的链接.从我的办公室PC.)

(I was going to provide links to the documentation at the Sybase web site, but it appears to be off-line for maintenance right now; I'll update this answer tomorrow when it's back up or I have access to links bookmarked from my office PC.)

这篇关于在Windows上使用PHP连接到Advantage数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆