sblisb 发表于:2009-07-04 21:50:04
原mdb文件升级成sql后出错
如下红色代码不能通过,提示"对象变量或with块未设置"如何修改正?是不是不支持dao?转成ado?
升迁成adp和 用mdb链接sql有什么区别?
Private Sub Form_Load()
On Error GoTo ErrForm_Load
Me.Label25.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss AMPM")
Dim db As Database, rst As Recordset, nodCurrent As Node
Dim objTree As TreeView, strText As String, nodRoot As Node
Dim bk As String
Set db = CurrentDb
' 打开雇员表.
Set rst = db.OpenRecordset("tbl_通讯录分类", dbOpenDynaset, dbReadOnly)
' Create a reference to the TreeView Control.
Set objTree = Me!TreeView0.Object
' 查找第一个上级
rst.FindFirst "[父号] Is Null"
' 向TREEVIEW装入数据
Do Until rst.NoMatch
' 取得NAME
strText = rst![内容]
' TREEVIEW第一层.
Set nodCurrent = objTree.Nodes.add(, , "a" & rst!序号, _
总记录:0篇 页次:0/0 9 1 :