VB6 and ASP Production Management System 1-create and add users (3)

Source: Internet
Author: User

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

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.