以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  添加数据  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=102427)

--  作者:peibaomin
--  发布时间:2017/6/19 18:13:00
--  添加数据

在数据添加前怎样判断

1、窗体体输入框(有文本框和日期框还有组合框)不能为空

2、判断数据库中是否有该条记录,禁止重复


--  作者:有点蓝
--  发布时间:2017/6/19 20:21:00
--  
1、
Dim txt As String = e.Form.controls("TextBox1").text
If txt = "" Then
    msgbox("xxx不能为空!")
    Return
End If
2、
Dim dr As DataRow = DataTables("表A").Find("编号=\'" & txt & "\'")
If dr IsNot Nothing
    msgbox("xxxz这条记录已经存在!")
End If