以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 窗口加载树 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=137299) |
-- 作者:禾成 -- 发布时间:2019/7/2 20:21:00 -- 窗口加载树 我的后台数据库是ACCESS 窗口的AfterLoad事件代码: Dim cmd As New SQL Command Dim dt As DataTable cmd.CommandText = "SELECT DISTINCT Year(报价日期) As 年, Month(报价日期) As 月, 客户 F rom {报价主表}" dt = cmd.ExecuteReader() Dim trv As WinForm.TreeView = e.Form.Controls("TreeView1") trv.BuildTree(dt, "年|月|客户") 目录树的NodeMouseDoubleClick事件代码 Dim dr As DataRow = e.Node.DataRow \'获取生成此节点的行 Dim Filter As String Dim Year As Integer = dr("年") Dim Month As Integer = dr("月") Dim Product As String = dr("客户") Select C ase e.N ode.Level Case 0 Filter ="Year(日期) = " & Year Case 1 Filter ="Year(日期) = " & Year & " And Month(报价日期) = " & Month Case 2 Filter ="Year(日期) = " & Year & " And Month(报价日期) = " & Month & " And 客户 = \'" & Product & "\'" End Select DataTables("报价主表").LoadFilter = Filter DataTables("报价主表").Load() 这是我照抄的,为什么不行?是不是ACCESS数据库的写法不是这样? 提示:(Microsoft Jet 数据库引擎找不到输入表或查询 \'~TMPCLP报价主表\'。 确定它是否存在,以及它的名称的拼写是否正确。) 错误所在事件:窗口,主窗口,AfterLoad 详细错误信息: Object reference not set to an instance of an object. 请老师指点
|
-- 作者:有点蓝 -- 发布时间:2019/7/2 21:21:00 -- 原因:http://www.foxtable.com/webhelp/topics/2344.htm |