以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  后台查询数据问题!  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=101866)

--  作者:fczhaobo
--  发布时间:2017/6/8 17:22:00
--  后台查询数据问题!
Dim xx As WinForm.ComboBox = e.Form.Controls("学校")
Dim xyfxmc As  String
xyfxmc = xx.Value
Dim fxbh As WinForm.TextBox = e.Form.Controls("学校编号")
Dim dr As DataRow
dr = DataTables("分校").SQLFind("分校名称 = \' xyfxmc \' ")

If dr Is Nothing Then
    msgbox("没找到")
Else
    fxbh.Text= dr("分校编号")
MessageBox.show(dr("分校编号"))
End If


有问题吗?老是没有找到呢??数据决对有啊,并且试过好几个了,都不行!

--  作者:lzzhx
--  发布时间:2017/6/8 17:27:00
--  
用下面代码试一试

Dim xx As WinForm.ComboBox = e.Form.Controls("学校")
Dim xyfxmc As  String
xyfxmc = xx.Value
Dim fxbh As WinForm.TextBox = e.Form.Controls("学校编号")
Dim dr As DataRow
dr = DataTables("分校").SQLFind("分校名称 = \'" &  xyfxmc  & "\'")

If dr Is Nothing Then
    msgbox("没找到")
Else
    fxbh.Text= dr("分校编号")
MessageBox.show(dr("分校编号"))
End If


--  作者:有点蓝
--  发布时间:2017/6/8 17:46:00
--  
合成表达式http://www.foxtable.com/webhelp/scr/1284.htm