关于vb的问题
悬赏分:15 - 离问题结束还有 14 天 23 小时
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "您必须输入用户名!", 48, "系统提示"
Exit Sub
ElseIf Text2.Text = "" Then
MsgBox "您必须输入密码!", 48, "系统提示"
Exit Sub
ElseIf Text3.Text <> Text2.Text Then
Text3.Text = ""
MsgBox "您输入密码错误!", 48, "系统提示"
Text3.SetFocus
Exit Sub
Else
Data1.Recordset.AddNew
Data1.Recordset.Fields("yh") = Text1
Data1.Recordset.Fields("mm") = Text2
Data1.Recordset.Fields("sex") = Option1
Data1.Recordset.Update
MsgBox "恭喜您注册成功!", 0, "系统提示"
End If
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Form2.Hide
Form1.Show
End Sub
请问VB高手如何加一段代码可以实现判断数据库中数据是否存在是否有重复的?
悬赏分:15 - 离问题结束还有 14 天 23 小时
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "您必须输入用户名!", 48, "系统提示"
Exit Sub
ElseIf Text2.Text = "" Then
MsgBox "您必须输入密码!", 48, "系统提示"
Exit Sub
ElseIf Text3.Text <> Text2.Text Then
Text3.Text = ""
MsgBox "您输入密码错误!", 48, "系统提示"
Text3.SetFocus
Exit Sub
Else
Data1.Recordset.AddNew
Data1.Recordset.Fields("yh") = Text1
Data1.Recordset.Fields("mm") = Text2
Data1.Recordset.Fields("sex") = Option1
Data1.Recordset.Update
MsgBox "恭喜您注册成功!", 0, "系统提示"
End If
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Form2.Hide
Form1.Show
End Sub
请问VB高手如何加一段代码可以实现判断数据库中数据是否存在是否有重复的?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货