以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  SQL存储过程in 怎么过滤 ?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=146456)

--  作者:jjcrazy
--  发布时间:2020/2/24 13:43:00
--  SQL存储过程in 怎么过滤 ?
Dim tb As Table = Tables("CMSMD")
Dim dbox As WinForm.DropDownBox = Forms("主窗口").Controls("DropboxSC")
Dim s As String
For Each i As Row In tb.GetCheckedRows

    s=  s & "\'" & i("MD001")   & "\'" & ","

    
Next
If s = "" Then
    MessageBox.Show("至少选择一列","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    dbox.Value= ""
Else
    MessageBox.Show(s.SubString(0,s.Length-1))
    dbox.Value= s.SubString(0,s.Length)
End If
e.Form.Close()

这样写,, 拼接出来的不对  得出的结果 不对
exec P_MOC N\'\'\'02\'\'\',N\'\'\'D01\'\',\'\'D02\'\'\'

--  作者:有点蓝
--  发布时间:2020/2/24 13:50:00
--  
表格里存储的是什么值?

Dim tb As Table = Tables("CMSMD")
Dim dbox As WinForm.DropDownBox = Forms("主窗口").Controls("DropboxSC")
Dim s As String
For Each i As Row In tb.GetCheckedRows
    s=  s & "\'" & i("MD001")   & "\',"
Next
msgbox(s) ‘显示什么内容?

--  作者:jjcrazy
--  发布时间:2020/2/24 15:48:00
--  SQL存储过程in 怎么过滤 ?
已经搞定了,谢谢老师 ,网上找了个分解函数