[求助]为什么不能把数据添加到数据库
Private Sub Text3_KeyPress(KeyAscii As Integer)If KeyAscii = 13 Then
If Text2.Text <> Text3.Text Then
MsgBox "两次输入的密码不一样,请从新输入!!"
Text3.SetFocus
Text3.Text = ""
ElseIf Text2.Text = Text3.Text Then
Adodc1.RecordSource = "select 用户名 from 登陆表 where 用户名='" & Text1.Text & "'"
If str.Fields(0) = Text1.Text Then
MsgBox "您输入的用户名已经存在,请从新输入!!"
Text1.Text = ""
Text1.SetFocus
Else
Adodc1.RecordSource = "Insert Into 登陆表 values ('& text1.text &','& text2.text &')"
Me.Hide
MDIFrmyingye.Show
End If
End If
End If
End Sub