Foxtable(狐表)用户栏目专家坐堂 → 总是出错


  共有2270人关注过本帖树形打印复制链接

主题:总是出错

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


加好友 发短信
等级:小狐 帖子:305 积分:2401 威望:0 精华:0 注册:2013/4/9 11:49:00
总是出错  发帖心情 Post By:2014/8/26 14:05:00 [只看该作者]

当前表中若没记录,执行下列代码总是出错
Dim ss As String
ss=Tables("mm_Table1").Current("身份证号")
Dim Result As DialogResult
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText ="select * From {hkxx} Where 身份证号 = '" & ss & "'"

If Tables("mm_table1").Position > 0 Then


  MessageBox.Show("当前表没有记录")
e.Cancel = True

Else
result = MessageBox.Show("是否修改当前数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
Forms("hkb").Open()

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

 回到顶部
帅哥哟,离线,有人找我吗?
Bin
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:35433 积分:178524 威望:0 精华:3 注册:2013/3/30 16:36:00
  发帖心情 Post By:2014/8/26 14:06:00 [只看该作者]

Dim ss As String
if Tables("mm_Table1").Current isnot nothing then
ss=Tables("mm_Table1").Current("身份证号")
Dim Result As DialogResult
Dim cmd As New SQLCommand
cmd.C
cmd.CommandText ="select * From {hkxx} Where 身份证号 = '" & ss & "'"

If Tables("mm_table1").Position > 0 Then


  MessageBox.Show("当前表没有记录")
e.Cancel = True

Else
result = MessageBox.Show("是否修改当前数据?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If Result = DialogResult.Yes Then
Forms("hkb").Open()

End If
end if
End If

 回到顶部