| |

VerySource

 Forgot password?
 Register
Search
View: 785|Reply: 1

VFP login issues

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-1-10 17:00:01
| Show all posts |Read mode
I built a user password table, and then a form, a login form, and a data source for the text box. It always displays the username and password without waiting for my input. What should I do?
? ? ? ?
Can anyone help write a code?
Thank you
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-5-23 21:00:02
| Show all posts
If you are wrong, you should set the data environment of the form to the table for storing passwords. If you don't add the data environment, add a file name of use table at the beginning of the code. Then build text boxes and buttons on the form, in the click event of the button:

(Assume that the table name is: yh, the user name field is: account number, and the password field is: password)

if empty (thisform.text1.value) .or. empty (thisform.text2.value)
   messagebox ("Please enter username and password", 16, "Error")
 else
   locat for account = trim (thisform.text1.value)
   if found ()
      if trim (thisform.text2.value) <> trim (password)
          messagebox ("The account password is incorrect, please confirm and re-enter", 16, "wrong")
          thisform.text1.value = ""
          thisform.text2.value = ""
       else
          yh = trim (thisform.text1.value)
          do form welcome
          release thisform
       endif
    else
      messagebox ("The account password is incorrect, please confirm and re-enter", 16, "wrong")
   endif
endif
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list