如题!

解决方案 »

  1.   

    我原来是在客户端建立一个dsn,然后通过dsn访问服务器。
      

  2.   

    Set dbs = New Connection
    dbs.Open "Driver={SQL Server};Server=" & strServerName & ";UID=" & strUID & ";PWD=" & strPWD & ";Database=" & strDbName & ";"
      

  3.   

    sqlStr = "Provider=SQLOLEDB;Data Source=192.168.0.121;DATABASE=muonline;UID=sa; Pwd=424426;"
    我也是这样的啊!但是提示我权限不够。我的SQL不是windows身份验证的。
    但是我上面的代码在网页里又运行正常,注web服务器是在SQL这台机子上的!请大家帮忙啊!
      

  4.   

    你建立一个用户DSN,然后用字符串
    Provider=MSDASQL.1;Persist Security Info=False;User ID=sa;Password=;Data Source=(DSN名称)
    试一下
      

  5.   

    dim cn as new adodb.connection
    cn.connectionstring="dsn=zq;"
    cn.open
    这样就连接到数据库了!
    前提是你必须在 控制面板/系统控制/系统数据源  中根据提示添加一个新的 dsn
      

  6.   

    Provider=SQLOLEDB.1;Password=<你的密码>;Persist Security Info=True;User ID=<用户ID>;Initial Catalog=<你要连接的数据库名>;Data Source=<远程服务器名或IP>
      

  7.   

    Dim Cnn As ADODB.ConnectionSet Cnn=New ADODB.Connection
    Cnn.CursorLocation = adUseClient
    Cnn.Open "Provider=SQLOLEDB.1;Password='" & 你的密码 & "';Persist Security Info=True;User ID=" & 用户ID & ";Initial Catalog=" & 你要连接的数据库名 & ";Data Source=" & 远程服务器名或IP