rsTopTen = new ActiveXObject("ADODB.Recordset");
ConnectionString = "DRIVER=SQL Server;SERVER=TopTen;CATALOG=TopTen;UID=TopTen;PWD=TopTen";
strSQL = "SELECT TopTenName, TopTenCount FROM TableNmae ORDER BY TopTenCount DESC";
rsTopTen.Open(strSQL, ConnectionString, 3,1,1);
while(!rsTopTen.EOF)
{
....
}

解决方案 »

  1.   

    // 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";
    //
    // for Access Database (on Server):
    //ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=\\\\demwwwdev01\\develop\\im\\security\\TopTen.mdb";
    //
    // for Access Database (on local drive):
    ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=C:\\TopTen\\TopTen.mdb";