944,093 Members | Top Members by Rank

Ad:
Jan 7th, 2007
0

visual basic

Expand Post »
hi there experts!!!im a new member in this site and i want to know certain thing about vb:
code of:
1.creating new password
2. adding new user
3. editing password
4. editing username

i know this is very simple for you guys i hope you can help me on this coz im just a starter in vb thanks

seeker:mrgreen:
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
seekerems is offline Offline
5 posts
since Jan 2007
Jan 7th, 2007
0

Re: visual basic

you first have to learn how to interact with a database through VB. The DB could be as simple as a text file or very complex such as MS Access or SQL Server.

As for the db code, create a menu on the main form for those three options you posted. Options 1 and 2 can be combined because you can only create a new user by adding a new password. As for option 4 -- edit user name -- that is normally not allowed because the user name is a unique key field in the database. To edit user name you normally have to delete the current user and recreate it with the new name as a new user.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,957 posts
since Aug 2005
Jan 7th, 2007
0

Re: visual basic

1. use: RecordsetName.Addnew
then save by using: RecordsetName.Update
2.same as above
3. just bind the textboxes into their corresponding Fields inside your Database everytime you click the edit button.
4. Same as No.3
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yuckadirri is offline Offline
7 posts
since Jan 2007
Jan 9th, 2007
0

Re: visual basic

thank you very much ...hope i can do it ..
Reputation Points: 10
Solved Threads: 0
Newbie Poster
seekerems is offline Offline
5 posts
since Jan 2007
Jan 9th, 2007
0

Re: visual basic

hi there!!for example i have these kind of forms:


UserName: __Textbox__
Current Password: _textbox__

enter new password: __textbox__
Re-enter password: __textbox__

_OK_ _CLEAR_ __SAVE__ __EXIT__ (Command button)

i have already set the DB file, the username and password, how can i run this??can you give me a sample code??
thank you very much=)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
seekerems is offline Offline
5 posts
since Jan 2007
Jan 9th, 2007
0

Re: visual basic

hi there!!for example i have these kind of forms:


UserName: __Textbox__
Current Password: _textbox__

enter new password: __textbox__
Re-enter password: __textbox__

_OK_ _CLEAR_ __SAVE__ __EXIT__ (Command button)

i have already set the DB file, the username and password, how can i run this??can you give me a sample code??
thank you very much=)
Reputation Points: 10
Solved Threads: 0
Newbie Poster
seekerems is offline Offline
5 posts
since Jan 2007
Jan 9th, 2007
0

Re: visual basic

How about something simple like (this code is not tested, use it just as a sample)

Your form structure:
Quote ...
Username: [textbox]
Password: [textbox]

[ login(button) ] [ cancel (button) ]
visualbasic Syntax (Toggle Plain Text)
  1. Private Sub Login_Click()
  2.  
  3. Dim conn As New ADODB.Connection
  4. Dim rs As New ADODB.Recordset
  5.  
  6. Dim user As String
  7. Dim password As String
  8.  
  9. user = txt_username.Text 'pull data from txt box
  10. password = txt_password.Text 'pull data from txt box
  11.  
  12. conn.Open "your_database_connection_string"
  13. rs.Open "select * from your_login_table"
  14.  
  15. 'make sure rs is not empty
  16. If rs.BOF = False Then
  17. While rs.EOF = False
  18. If user = rs.Fields("Column_Name_For_Username") And _
  19. password = rs.Fields("Column_Name_For_Password") Then
  20. MsgBox "Validation successful"
  21. Exit Sub
  22. End If
  23. rs.MoveNext
  24. Wend
  25.  
  26. MsgBox "No such user exists"
  27. Else
  28. MsgBox "The recordset is empty", vbCritical
  29. End If
  30.  
  31. End Sub
Last edited by ~s.o.s~; Jan 9th, 2007 at 3:10 pm.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
~s.o.s~ is offline Offline
8,873 posts
since Jun 2006
Jan 10th, 2007
0

Re: visual basic

thank you very much, this will help me a lot...
Reputation Points: 10
Solved Threads: 0
Newbie Poster
seekerems is offline Offline
5 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: ActiveX DLL reference
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: VB Report





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC