如体,具体SQl语句操作知道,只是不知如何实现?如:RS 为adodb.recordset 对象,怎样对其实现查询ID=110的操作?  即此语句 SQl=“select * from table where Id='110'”如何与 RS对象衔接?

解决方案 »

  1.   

    dim con as new adodb.connection
    con.connectiongstring="---------"
    dim rs as new adodb.recordset
    rs.open “select * from table where Id='110'”,con,1,1
      

  2.   

    dim cn as new adodb.connection
       dim rs as new adodb.recordset
       cn.open "....联接串"
       sSql="select * from " + AdoPara.Dbtable + " where [JS_country] like '" & Country & "'"
       rs.Open sSql, cn, 1, 1
    ...
      

  3.   

    dim con as new adodb.connection
    con.connectiongstring="---------"
    dim rs as new adodb.recordset
    set rs=con.execute("select * from table where Id='110'")
      

  4.   

    dim cn as new adodb.connection
       dim rs as new adodb.recordset
       cn.open "....联接串"
       sSql=“select * from table where Id='110'”
       rs.Open sSql, cn, 1, 1
    ...
      

  5.   

    Dim mySql As StringSet myConn = New ADODB.Connection
    myConn.ConnectionString = "实现与数据库连接子串"
    myConn.Open
    Set myRecord = New ADODB.Recordset
    mySql = "select * from table where Id='110'"
    myRecord.Open mySql, myConn, adOpenDynamic, adLockBatchOptimistic