用vb6.0中的ado对象怎样连接sqlserver2000?最好是有实例让我学学,谢谢大家!

解决方案 »

  1.   

    dim   cn   as   new   adodb.connection  
      dim   rs   as   new   adodb.recordset  
      cn.open   "Provider=SQLOLEDB.1;Password=密码;Persist   Security   Info=True;User   ID=sa;Initial   Catalog=数据库;Data   Source=服务器"  
      rs.CursorLocation   =   adUseClient  
      rs.CursorType   =   adOpenStatic  
      rs.open   "select  * from xxx",cn  
     
      ...  
      rs.close  
      set   rs=nothing  
      cn.close  
      set   cn=nothing
      

  2.   


    就是这个,另外多看MSDN,里面啥都有。