home *** CD-ROM | disk | FTP | other *** search
- Sub cmdCancel_Click ()
- Unload Me
- End Sub
-
- Sub cmdOK_Click ()
- If txtUserName = "" Or txtUserPassword = "" Then
- MsgBox "You must supply both Name and Password.", 16
- Exit Sub
- End If
-
- If txtConfirmPassword = "" Then
- MsgBox "You must supply the confirmation password.", 16
- Exit Sub
- End If
-
- If txtUserPassword <> txtConfirmPassword Then
- MsgBox "The New Password and Confirm Password must be the same.", 16
- Exit Sub
- End If
-
- NewUser = txtUserName
-
- Dim Db As database, Ds As dynaset
- Set Db = OpenDatabase("e:\vbpass\protect.mdb")
- Set Ds = Db.CreateDynaset("select * from mtUserInfo where UserName like '" & txtUserName & "';")
-
- If Ds.RecordCount > 0 Then
- MsgBox "An account with that user name already exists on the system!", 16
- Ds.Close
- Db.Close
- Exit Sub
- End If
-
- Secret$ = txtUserPassword
- Password$ = "wibble"
- Call Encrypt(Secret$, Password$)
-
- Ds.AddNew
- Ds("UserName") = txtUserName
- Ds("UserPassword") = Secret$
- Ds.Update
- Ds.Close
- Db.Close
-
- MsgBox "New User Created.", 64
-
- Unload Me
- End Sub
-
-
-