以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]查询代码加载数据失败 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=101559) |
-- 作者:benwong2013 -- 发布时间:2017/6/2 16:29:00 -- [求助]查询代码加载数据失败 Dim Filter As String With e.Form.Controls("Addno") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "convert(添加编号, \'System.String\') like \'%" & .Value & "%\'" End If End With With e.Form.Controls("Recordman") If .Value IsNot Nothing Then If Filter >"" Then Filter = Filter & " And " End If Filter = Filter & "convert(记录人, \'System.String\') like \'%" & .Value & "%\'" End If End With If Filter > "" Then DataTables("B_TtemNo").LoadFilter = Filter DataTables("B_TtemNo").Load() End If 提示: .NET Framework 版本:2.0.50727.8669 Foxtable 版本:2017.5.22.1 错误所在事件:加载[B_TtemNo]失败! 详细错误信息: 类型 记录人 不是已定义的系统类型。 请问是什么问题? [此贴子已经被作者于2017/6/2 16:45:03编辑过]
|
-- 作者:benwong2013 -- 发布时间:2017/6/2 17:00:00 -- 数据库是用SQL |
-- 作者:有点色 -- 发布时间:2017/6/2 17:04:00 -- Dim Filter As String
With e.Form.Controls("Addno")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(添加编号, varchar) like \'%" & .Value & "%\'"
End If
End With
With e.Form.Controls("Recordman")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "convert(记录人, varchar) like \'%" & .Value & "%\'"
End If
End With
If Filter > "" Then
DataTables("B_TtemNo").LoadFilter = Filter
DataTables("B_TtemNo").Load()
End If |
-- 作者:benwong2013 -- 发布时间:2017/6/2 17:20:00 -- Filter = Filter & "convert(varchar,添加编号) like \'%" & .Value & "%\'" 应该改成这样才可以,不过还是谢谢!!!
[此贴子已经被作者于2017/6/2 17:19:56编辑过]
|