Dim CN As New ADODB.Connection                '定义数据库的连接
    Dim Rs As New ADODB.Recordset
    CN.ConnectionString = "Provider=sqloledb;Data Source=200;Initial Catalog=autoinfo;User Id=myh;Password=bscr79403;"
    CN.Open
----
兄弟这段代码支持远程sql数据库放问吗。

解决方案 »

  1.   

    将Data Source改成用ip地址访问即可
    如:
     Connect via an IP address:cN.ConnectionString = "Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=sa;Password=asdasd;" (DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
      

  2.   

    Connect via an IP address:
    DBMSSOCN=TCP/IP instead of Named Pipes, at the end of the Data Source is the port to use (1433 is the default))
    这两句什么意思?
      

  3.   

    将Data Source改成用ip地址访问
    可这样好像连接速度方面会下降,如果一定要用计算机名要怎么做?