Sub Form1_Load()
Dim db As Database
Dim ds As Snapshot
Dim iNum As Integer '总笔数
Dim wsql As String 'SQL字串
wsql = "Select Count (*) from Authors Where AU_ID > 10"
Set db = OpenDatabase("c:\vb\biblio.mdb")
Set ds = db.CreateSnapshot(wsql)
iNum = ds(0)
MsgBox "总笔数为 " + Str$(iNum)
End Sub
怎么样,是不是一样呢,只差在一个是 ADO,一个是 DAO 而已!
- 还没有人评论,欢迎说说您的想法!