菜单 工具 -〉引用-〉Micorsoft Access 11.0 Objects library 试试
Set Public conn As New ADODB.Connection '定义新连接 Public cmd As New ADODB.Command '定义指令 Public rs As New ADODB.Recordset '定义两个记录集
set conn = New Connection conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\制图\数据库\塔巴庙探井.mdb" Set cmd.ActiveConnection = conn cmd.CommandText = "select * from 表名"
rs.CursorLocation = adUseClient
rs.Open cmd, , adOpenStatic, adLockBatchOptimistic |