ado对象远程访问SQL server数据库,实现网络版软件功能,
要注意那些?
现有一局域网软件,如何实现广域网
远程访问远程数据库

解决方案 »

  1.   

    MS Remote - SQL Server 
    If you want to use an ODBC DSN on the remote machineoConn.Open "Provider=MS Remote;" & _
               "Remote Server=http://myServerName;" & _ 
               "Remote Provider=MSDASQL;" & _
               "DSN=myDatabaseName;" & _
               "Uid=myUsername;" & _
               "Pwd=myPassword" 
     
    If you want to use an OLE DB Provider on the remote machineoConn.Open "Provider=MS Remote;" & _ 
               "Remote Server=http://myServerName;" & _
               "Remote Provider=SQLOLEDB;" & _
               "Data Source=myServerName;" & _
               "Initial Catalog=myDatabaseName;" & _
               "User ID=myUsername;" & _
               "Password=myPassword"
     
    If you want to use an OLE DB Provider on the remote machineoConn.Open "Provider=MS Remote;" & _ 
               "Remote Server=http://myServerName;" & _ 
               "Handler=MSDFMAP.Handler;" & _
               "Data Source=MyPubsConn" 
    The corresponding entry in the \winnt\Msdfmap.ini file would be:[connect MyPubsConn]
    Access = ReadWrite
    Connect = "Provider=SQLOLEDB;
              Data Source=myServerName;
              Initial Catalog=myDatabaseName;
              User ID=myUsername;
              Password=myPassword"        (put all of this on single line!)
      

  2.   

    MS Remote - Access (Jet) 
    If you want to use an ODBC DSN on the remote machineoConn.Open "Provider=MS Remote;" & _
               "Remote Server=http://myServerName;" & _ 
               "Remote Provider=MSDASQL;" & _
               "DSN=AdvWorks;" & _
               "Uid=myUsername;" & _
               "Pwd=myPassword" 
     
    If you want to use an OLE DB Provider on the remote machineoConn.Open "Provider=MS Remote;" & _ 
               "Remote Server=http://myServerName;" & _
               "Remote Provider=Microsoft.Jet.OLEDB.4.0;" & _
               "Data Source=c:\somepath\mydb.mdb", _
                "admin", ""
     
    If you want to use an OLE DB Provider on the remote machineoConn.Open "Provider=MS Remote;" & _ 
               "Remote Server=http://myServerName;" & _
               "Handler=MSDFMAP.Handler;" & _
               "Data Source=MyAdvworksConn"
    The corresponding entry in the \winnt\Msdfmap.ini file would be:[connect MyAdvworksConn]
    Access = ReadWrite
    Connect = "Provider=Microsoft.Jet.OLEDB.4.0;
               Data Source=mydb.mdb;
               User Id=admin; 
               Password="               (put all of this on single line!)
    在Windows 2000下面,由于RDS的缺省安全配置同IIS4不同,从而造成RDS无法正常使用,以下是本人根据微软 MDAC 2.6 SDK 的 ADO 文档中关于RDS的说明部分翻译并整理总结而成的配置步骤,在我所配置的服务器中都获得成功,现供大家参考。1、用“计算机管理”工具查看 IUSR_<ComputerName> 用户是否在Guests 组中,如果没有请加入。2、单击“开始”-“运行”,输入“msdfmap.ini”,按回车编辑该文件,或直接在NT安装目录下找到该文件双击,找到“[CONNECT DEFAULT]”项,如果Access参数的当前值是“NOACCESS”,将其改为“READONLY”。3、运行“Internet服务管理器”,查看“默认Web站点”-“MSADC”虚拟目录的属性,将执行许可设为“脚本和可执行程序”;查看“目录安全性”-“IP地址及域名限制”,改为对所有地址授权访问4、将以下内容另存为后缀名为.reg的注册表文件,并将其导入注册表:
    REGEDIT4[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ADCLaunch\RDSServer.DataFactory];将RDS的安全级别降低
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataFactory][HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataFactory\HandlerInfo]
    "handlerRequired"=dword:00000000
    "DefaultHandler"=""[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataFactory\HandlerInfo\safeHandlerList][HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataFactory\HandlerInfo\safeHandlerList\MSDFMAP.Handler][HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataFactory\HandlerInfo\safeHandlerList\MSDFMAP_VB.Handler][HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\DataFactory\HandlerInfo\safeHandlerList\MSDFMAP_VC.Handler]5、停止并重新启动 WWW 服务,如果上述修改仍不起作用,重新启动服务器。