1、先用一组代码:测得结果都是1
Dim 年月 As WinForm.co_mbobox = e.Form.Co_ntrols("年月")
For Each dr1 As DataR_ow In Da_taTables("用户信息表").Se_lect( " 单位代码 < 3800 ","单位代码" )
dr1("月工资记录数") = 0
dr1("月工资数据冻结") = 0
Next
Dim cm_d As New S_QL_Co_mm_and
Dim dt As DataTable
c_md.C
For Each dr1 As Dat_aRow In Data_Tables("用户信息表").Sel_ect( " 单位代码 < 3800 ","单位代码" )
c_md.Co_mm_andT_ext = "Se_lect cou_nt(单位代码) From {网络教职工} Where 单位代码 = "& dr1("单位代码") &" And 台帐年月 = '"& 年月.text &"' "
dr1("月工资记录数") = c_md.Exec_uteScalar()
c_md.Co_mm_and_Text = "Se_lect m_ax(冻结) From {网络教职工} Where 单位代码 = "& dr1("单位代码") &" And 台帐年月 = '"& 年月.text &"' "
dr1("月工资数据冻结") = c_md.Exec_uteS_calar()
Next
2、
Dim 年月 As WinForm.co_mbobox = e.Form.Co_ntrols("年月")
Dim c_md As New SQ_L_Co_mm_and
Dim dt As DataTable
c_md.Co_nn_ectio_nName = "网络化教育"
For Each dr1 As DataRow In DataTables("用户信息表").Sele_ct( " 单位代码 < 3800 ","单位代码" )
If dr1("月工资记录数") > 0 Then
c_md.Co_mm_andText = " UP_DA_TE {网络教职工} SE_T 冻结 = 2 wh_ere 单位代码 = "& dr1("单位代码") &" And 台帐年月 = '"& 年月.text &"' "
c_md.Co_mm_andText = " Se_lect ma_x(冻结) From {网络教职工} Wh_ere 单位代码 = "& dr1("单位代码") &" And 台帐年月 = '"& 年月.text &"' "
dr1("月工资数据冻结") = c_md.Ex_ec_uteS_calar()
End If
Next
结果返回的结果还是1,请教老师,这是什么原因,原来的数值1也是用这种命令处理的,后来代码丢失了就重写的,但找不到错误的原因了。 恳请老师指点
[此贴子已经被作者于2018/8/9 23:10:00编辑过]