Access交流中心

北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |

如下代码显示为未定义是什么意思呢? Rec.Open "大区表", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTa

付露露  发表于:2015-10-07 16:01:45  
复制

你好,

此段代码运行到红字处出现错误,是什么原因呢?

Private Sub Form_Load()



Dim Rec As New ADODB.Recordset
Dim stRecQL As String
Dim Item As Integer
Dim i As Integer
Dim nodindex As Node


Set nodindex = TreeView.Nodes.Add(, , "爷", "销售客户", "K1", "K2")
nodindex.Sorted = True


Rec.Open "大区表", CurrentProject.Connection, adopenkeyset, adlockoptimistic, adcmdtabledirect
For i = 1 To Rec.RecordCount - 1
Set nodindex = TreeView.Nodes.Add("爷", tvwChild, "父" & Rec.Fields("大区ID"), Rec.Fields("大区名称"), "K1", "K2")
nodindex.Sorted = True
Rec.MoveNext
Next
Rec.Close


Rec.Open "省份表", CurrentProject.Connection, adopenkeyset, adlockoptimistic, adcmdtabledirect
For i = 1 To Rec.RecordCount - 1

Set nodindex = TreeView.Nodes.Add("父" & Rec.Fields("所属大区"), tvwChild, "子" & Rec.Fields("省份ID"), Rec.Fields("省份名称"), "K1", "K2")nodindex.Sorted = True
Rec.MoveNext
Next
Rec.Close
Rec.Open "客户表", CurrentProject.Connection, adopenkeyset, adlockoptimistic, adcmdtabledirect
For i = 1 To Rec.RecordCount - 1
Set nodindex = TreeView.Nodes.Add("子" & Rec.Fields("所属省份"), tvwChild, "孙" & Rec.Fields("客户ID"), Rec.Fields("客户名称"), "K1", "K2")
nodindex.Sorted = True
Rec.MoveNext
Next
Rec.Close




End Sub

      


如下代码显示为未定义是什么意思呢?

Rec.Open "大区表", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, adCmdTableDirect


 

Top
缪炜 发表于:2015-10-08 08:22:57

你重新引用一下ADO



杜超 发表于:2015-10-08 16:21:41
access编译错误:用户定义类型未定义的解决方法[Access软件网]
http://www.accessoft.com/article-show.asp?id=5049

总记录:2篇  页次:1/1 9 1 :