As mentioned last time, after logging on, uninstall the logon window and display the management interface;
Design the interface as needed.
The following figure shows the form. Let's take a look. Just know what controls to use!
You only need to add the code at the command1 button:
Add users using two text controls and one command control.
The text control is named txtuser and txtpass respectively.
Double-click command1 to add the following code:
Haha, used to asp Writing,
You can also directly use: conn. Execute ("insert inst statement directly ")
1 private sub commandementclick ()
2 'add user
3 dim Tuser
4 dim tpass
5 Tuser = trim $ (txtuser. Text)
6 tpass = trim $ (txtpass. Text)
7
8 If Tuser = "" then
9 msgbox "user name cannot be blank"
10 txtuser. setfocus
11 exit sub
12 end if
13 if tpass = "" then
14 msgbox "the password cannot be blank"
15. txtpass. setfocus
16 exit sub
17 end if
18
19 'Open the database connection
20 call openconn
21 SQL = "select * From vuinfo"
22 Rs. Open SQL, Conn, 1, 3
23 Rs. addnew
24 Rs. Fields ("username") = Tuser
25 Rs. Fields ("password") = tpass
26 Rs. Fields ("userpower") = 0
27 Rs. Update
28' close database connection
29 call closeconn
30
31 msgbox "User Added"
32 txtuser. Text = ""
33 txtpass. Text = ""
34. txtuser. setfocus
35 end sub