当知道远程服务器ip地址,数据库名称和用户名密码,怎样写连接控件的connectionstring才能连到远程服务器数据库,连接方必须安装sybase客户端吗?

解决方案 »

  1.   

    看看http://www.delphibbs.com/delphibbs/dispq.asp?lid=2333904
      

  2.   

    http://www.delphibbs.com/delphibbs/dispq.asp?lid=2610334
    另外转贴:
    使用ADO 连 SYBASE 数据库时通过设置
    ConnectionString=Provider=MSDASQL.1;Password=PWD;Persist Security Info=True;User ID=ID;Mode=ReadWrite;Extended Properties="DRIVER={Sybase System 11};UID=ID;PWD=PWD;;SRVR=SERVER1;DB=DB1"
    连接 SYBASE 数据库 (这是通过ODBC连接,但不用设置ODBC数据源,SYBASE要装客户端)
    数据浏览一切正常,但修改数据后更新时报“数据提供程序或其他服务返回E_FAIL状态”错误,不能修改数据。 后上网查询加在 ConnectionString 中增加 WorkArounds2=24 解决问题,现提供大家希望对某人能人帮助。下附原文:
    用ADO连接 SYBASE 数据库进行数据更新时产生E_FAIL错误的处理:
    Patch : Sybase ADO provider returned an E_FAIL status message
    Document Number: 2462788MJ
    Defect Number: 15004030
    Category: Patch
    Created: 01/13/2003 by Michael Jacobs 
    Last Modified: 08/04/2003 by Michael Jacobs
    Product Information
    Product: Connect for ADO
    Version: 2.7.00
    Operating System: Windows 32 bit
    Database: Sybase
    Analysis
    When using the Connect for ADO 2.70 Sybase provider with a VB application to SELECT IMAGE or TEXT data, you may receive the error message: E_FAIL status.
    Resolution
    The initial resolution for this error message is to set: WorkArounds2=24 for the data source.  Please try setting this in the "Options" tab of the data source under "Provider Options" or pass this setting in the connection string.
    ** NOTE ** Case sensitivity is very important when setting this workaround.
    If setting this value does not resolve the issue, then contact DataDirect SupportLink to obtain build 2.70.0012 or higher of the Connect for ADO Sybase provider.
      

  3.   

    问题解决了,首先安装sybase oledb
      

  4.   

    使用ADO一般的连接串都是类似的:
    DataModule.Connection1.ConnectionString='Provider=MSDASQL.1;Password=PWD;Persist'
        + ' Security Info=True;User ID=ID;Mode=ReadWrite;Extended'
        + ' Properties="DRIVER='{Sybase System 11};UID=ID;PWD=PWD;;SRVR=SERVER1;DB=DB1"'