如果 Sql Server的端口不是默认的1433,而是别的,比若说是7878.那连接字符串Cnxn1.ConnectionString = "Provider='sqloledb';Data Source='MySqlServer';" & _
        "Initial Catalog='Pubs';Integrated Security='SSPI';"
该如何写呢?有没有Port这个属性?
谢谢!!

解决方案 »

  1.   

    你指定服务器名吧,不过我没试过,CSDN上好象见过有关的贴子,你可以找一下,。
      

  2.   

    Cnxn1.ConnectionString = "Provider='sqloledb';Data Source='MySqlServer';" & _
            "Initial Catalog='Pubs';Integrated Security='SSPI';"把‘Data Source='MySqlServer'改成
    "Data Source=192.168.4.1,7878"
      

  3.   

    Connect via an IP address:
    "Provider=sqloledb;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))
      

  4.   

    ?有没有Port这个属性????這個不清楚﹐沒有想過這問題。樓上的很厲害的。他說的()也許 就是正確的﹐呵