本人设计一个模块和一个窗体(包含一个treeview)模块内容为
Option Explicit
Global Conn As New ADODB.Connection
Global usernow As usertype
Type usertype
id As String
type As Integer
End Type
Sub sql1()
Dim strConn As String
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "/1.mdb;Persist Security Info=False"Conn.CursorLocation = adUseClient
Conn.Open strConn
End Sub
窗体内容为
Public tree2 As New ADODB.Recordset
Public DBt2 As String
public proj0,proj1,proj2,proj3 as node
Private Sub Form_Load()
Call sql1
Set proj0 = TreeView1.Nodes.Add(, , "t0", "国际级项目")
Set proj1 = TreeView1.Nodes.Add(, , "t1", "国家级项目")
Set proj2 = TreeView1.Nodes.Add(, , "t2", "省、市级项目")
Set proj3 = TreeView1.Nodes.Add(, , "t3", "企业合作项目")
END subPrivate Sub TreeView1_Click()
TreeView1.Nodes(1).Expanded = TrueDBt2 = "select * from 项目管理表 where ADD_MAN='" & usernow.id & "' and PROJ_TYPE='0'"
tree2.Open DBt, Conn, adOpenStatic, adLockReadOnly, -1
'上面一行提示标准表达式中数据类型不匹配MsgBox tree2.Fields("PROJ_NAME")
End Sub
请问是什么原因