如何使用vba管理访问表中的数据



发生了什么变化?我以前用过:

DIM db as database 
DIM rst as Recordset 
set db = CurrentDB 
Set rst = db.OpenRecordset("Tablename") 
rst.movefirst 
'...etc 

现在,这不再适用于我的64位Access应用程序。我正在使用一台新的高规格HP笔记本电脑和最新的Office 365产品。请帮忙。。。!

如果表名存在,它将起作用:

Dim db  As DAO.Database 
Dim rst As DAO.Recordset 
Set db = CurrentDB 
Set rst = db.OpenRecordset("Tablename") 
If rst.RecordCount > 0 Then
rst.movefirst 
'...etc 
End If
rst.Close

最新更新