我正在使用VB6进行编码。
因为我正在使用树视图。
我的代码如下:
Dim rptNode As Node
Dim intTemp As Integer
Dim intRpts As Integer
Dim strSQL As String
Dim rsTreeItems As ADOdb.Recordset
Dim rsReports As ADOdb.Recordset
'~~~~~~~~To remove error handling, remove code between tildes~~~~~~~~~
On Error GoTo Initialize_TreeView_ErrorHandler
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tvwRpts.LineStyle = tvwTreeLines
tvwRpts.Nodes.CLEAR
'add root node
Set rptNode = tvwRpts.Nodes.Add(, , "Root", "Reports")
Set rsTreeItems = New ADOdb.Recordset
Set rsReports = New ADOdb.Recordset
此代码给出了行错误:
Set rptNode = tvwRpts.Nodes.Add(, , "Root", "Reports",1)
它声明:
error in initializing tree view type mismatch
当我添加手表时,它只是给出:
<key is not unique in collection>
请帮帮我。