其中问号是han'zi
详细代码:
Private Sub cmdCancel_Click()
DoCmd.Close
End Sub
Private Sub cmdOk_Click()
Dim rs As New ADODB.Recordset
Dim txtSQL As String
If IsNull(txtName) = True Or IsNull(txtPwd1) = True Then
MsgBox "?????????????????", vbExclamation, "????"
txtName.SetFocus
Exit Sub
ElseIf txtPwd1 <> txtPwd2 Or IsNull(txtPwd2) = True Then
MsgBox "??????£???????????", vbExclamation, "????"
txtName.SetFocus
Exit Sub
Else
txtSQL = "select * from ????? where ??????? = ' " & txtName & " ' "
rs.Open txtSQL, CurrentProject.Connection, adOpenStatic, adLockReadOnly
If rs.RecordCount <> 0 Then
MsgBox "????????", vbExclamation, "????"
txtName.SetFocus
rs.Close
Exit Sub
Else
txtSQL = "select * from ?????"
rs.Close
Set rs = New ADODB.Recordset
rs.Open txtSQL, CurrentProject.Connection, adOpenStatic, adLockPessimistic
rs.AddNew
rs!????? = txtName
rs!???? = txtPwd1
rs.Update
MsgBox "?????", vbInformation, "?????"
txtName = ""
txtPwd1 = ""
txtPwd2 = ""
txtName.SetFocus
End If
End If
End Sub