# Re: VB6 ADO Recordset问题?

Posted by 大汉堡 on August 24, 1999 at 23:47:21:

In Reply to: VB6 ADO Recordset问题? posted by Lai on August 23, 1999 at 14:49:20:

: vb6 dao上
: dim db as database
: dim rs1 as recordset
: dim rs2 as recordset
: Set db = DBEngine.Workspaces(0).OpenDatabase("xxx.mdb")
: Set rs1 = db1.OpenRecordset("table1",dbOpenTable)
: Set rs2 = db1.OpenRecordset("table2",dbOpenTable)
: 请问在vb6 ado上要如何描述?或有何书籍可参考

基本上ADO及DAO所开启的RecordSet是不同的,其属性也
有相当程度的差异(虽然DAO我仅练习时用过),所以要
作这个描述,会觉得难以下手
但如要使用ADO,可如下宣告
Dim rs1 as New ADODB.Recordset
Dim rs2 as New ADODB.Recordset
Dim SQL_str as String
Dim CON_str as String
SQL_str = 要Run的SQL Statement(若为Select则传回Recordset)
CON_str = ConnecttionString
rs1.open CON_str,SQL_str(后面还有两个有关Recordset的属性,这里不说了)
这样就可开启rs1这个ADO的Recordset
若想更深入...王国荣先生的'VisualBasic资料库程式设计'
有详细的介绍

Follow Ups: