Foxtable(狐表)用户栏目专家坐堂 → [求助]帮看下哪个地方出了问题?


  共有3080人关注过本帖平板打印复制链接

主题:[求助]帮看下哪个地方出了问题?

帅哥哟,离线,有人找我吗?
花开的声音
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1172 积分:8418 威望:0 精华:0 注册:2012/10/29 20:09:00
[求助]帮看下哪个地方出了问题?  发帖心情 Post By:2014/6/6 12:59:00 [只看该作者]

原来ACCESS数据库时运行正常,但转换为SQL数据库后运行出错,如图。

图片点击可在新窗口打开查看此主题相关图片如下:qq图片20140606125146.jpg
图片点击可在新窗口打开查看

以下代码,看得到显示第1个信息框,看不到第2个信息框就出错误提示了。也就是说在运行dt = cmd.ExecuteReader()这句代码时出错,帮看下哪个地方的问题。

Dim xsxm As WinForm.CheckedComboBox = e.Form.Controls("显示项目")
Dim tv As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim s As String
Dim t As Table
Dim filt As String
Dim flt As String
Dim nlflt As String
Dim dr As DataRow
Dim dt As DataTable
'Select cxlb.Value
'Case "人员信息"
'Select cxny.Value
' Case "基层法律服务工作者"
' Forms("法律服务人员查询").Open
s = e.Form.Controls("显示项目").Text
If s = "" OrElse s = "选择显示项目" Then
    Return
End If
't = Tables("基层法律服务人员信息表")
If User.Group = "遵义市司法局" Then
    filt = "1 = 1"
Else
    filt = "主管司法局 = '" & User.Group & "'"
End If
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText = "Select [_Identify],身份证号码,主管司法局,法律服务所,性别,姓名,学历学位,学历学位序号,序号,IIF(年龄 < 20 ,'小于20',IIF(年龄 Between 20 And 25,'20-25',IIF(年龄 Between 26 And 30, '26-30',IIF(年龄 Between 31 And 35, '31-35'," & _
"IIF(年龄 Between 36 And 40,'36-40',IIF(年龄 Between 41 And 45,'41-45',IIF(年龄 Between 46 And 50,'46-50',IIF(年龄 between 51 And 55,'51-55',IIF(年龄 between 56 And 60,'56-60',IIF( 年龄 between 61 And 65,'61-65',IIF(年龄 between 66 And 70,'66-70','大于70'))))))))))) As 年龄" & _
" From {基层法律服务人员信息表} Where " & filt

MessageBox.Show("1")
dt = cmd.ExecuteReader()
MessageBox.Show("2")
[此贴子已经被作者于2014-6-6 13:01:47编辑过]

 回到顶部