代码哪里错了哦?vb查询access数据库连接treeview,提示“集合中的关键字不唯一”
Adodc1.RecordSource="selectZYMCfromZYLB"Adodc1.RefreshDoWhileNotAdodc1.Recordset.EOFK...
Adodc1.RecordSource = "select ZYMC from ZYLB"
Adodc1.Refresh
Do While Not Adodc1.Recordset.EOF
Key = Adodc1.Recordset.Fields("ZYMC")
Text = Adodc1.Recordset.Fields("ZYMC")
Set node1 = TreeView1.Nodes.Add(, tvwChild, Key, Text)
Adodc1.Recordset.MoveNext
Adodc2.RecordSource = "select FC from FCB where ZYID=" & 1 & "
Adodc2.Refresh
Do While Adodc2.Recordset.EOF = False
Key = Adodc2.Recordset.Fields("FC")
Text = Adodc2.Recordset.Fields("FC")
Set node2 = TreeView1.Nodes.Add(node1.index, tvwChild, Key, Text)
Adodc2.Recordset.MoveNext
Loop
Loop
顺便TreeView1.Nodes.Add(, tvwChild, Key, Text)这句话能用通俗的语句解释下吗?主要是前2个 逗号 展开
Adodc1.Refresh
Do While Not Adodc1.Recordset.EOF
Key = Adodc1.Recordset.Fields("ZYMC")
Text = Adodc1.Recordset.Fields("ZYMC")
Set node1 = TreeView1.Nodes.Add(, tvwChild, Key, Text)
Adodc1.Recordset.MoveNext
Adodc2.RecordSource = "select FC from FCB where ZYID=" & 1 & "
Adodc2.Refresh
Do While Adodc2.Recordset.EOF = False
Key = Adodc2.Recordset.Fields("FC")
Text = Adodc2.Recordset.Fields("FC")
Set node2 = TreeView1.Nodes.Add(node1.index, tvwChild, Key, Text)
Adodc2.Recordset.MoveNext
Loop
Loop
顺便TreeView1.Nodes.Add(, tvwChild, Key, Text)这句话能用通俗的语句解释下吗?主要是前2个 逗号 展开
3个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询