rsTopTen = new ActiveXObject("ADODB.Recordset");// Build the connection string// ConnectionString Format below:
//ConnectionString = "DRIVER=SQL Server;SERVER=MySQLServer;CATALOG=MyDatabase;UID=USERID;PWD=Password";
//
// for SQL 7.0:
ConnectionString = "DRIVER=SQL Server;SERVER=TopTen;CATALOG=TopTen;UID=TopTen;PWD=TopTen";
//
// Build a SQL statement
strSQL = "SELECT TopTenName, TopTenCount FROM TopTen ORDER BY TopTenCount DESC";// Open the recordset
rsTopTen.Open(strSQL, ConnectionString, 3,1,1);

解决方案 »

  1.   

    rsTopTen = new ActiveXObject("ADODB.Recordset");
    ConnectionString = "DRIVER=SQL server;SERVER=TopTen;CATALOG=TopTen;UID=TopTen;PWD=TopTen";
    strSQL = "SELECT TopTenName, TopTenCount FROM TopTen ORDER BY TopTenCount DESC";
    rsTopTen.Open(strSQL, ConnectionString, 3,1,1);
    这四句就够了???
    那个TopTen是什么?????
      

  2.   

    rs = new ActiveXObject("ADODB.RecordSet");
        ConnectionString = "DRIVER=SQL server;SERVER=NBHC-SZY;CATALOG=mydata;UID=sa;PWD=sizy";
        var sqlStr = "SELECT * FROM tbm01 WHERE tba011c= comid";
        rs.open(sqlStr,ConnectionString,3,1,1);
    我这样用了
    出错提示tbm01无效
    为什么????那时库里的一张表啊
      

  3.   

    加 DATABASE=database 试试。
      

  4.   

    ??什么意思??
    ConnectionString再加一个参数?
    但现在CATALOG=mydata就是指明database了阿
    ...
    虽然还没有成功,还是谢谢你们的帮忙
      

  5.   

    加了以后报了个打开"mydata"数据库失败
    然后我改成'sa' 它又成了登录sa失败
    ....是不是写的细节有问题??