visual basic

Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2007
Posts: 5
Reputation: seekerems is an unknown quantity at this point 
Solved Threads: 0
seekerems seekerems is offline Offline
Newbie Poster

visual basic

 
0
  #1
Jan 7th, 2007
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:
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,654
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1500
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: visual basic

 
0
  #2
Jan 7th, 2007
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 7
Reputation: yuckadirri is an unknown quantity at this point 
Solved Threads: 0
yuckadirri yuckadirri is offline Offline
Newbie Poster

Re: visual basic

 
0
  #3
Jan 7th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 5
Reputation: seekerems is an unknown quantity at this point 
Solved Threads: 0
seekerems seekerems is offline Offline
Newbie Poster

Re: visual basic

 
0
  #4
Jan 9th, 2007
thank you very much ...hope i can do it ..
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 5
Reputation: seekerems is an unknown quantity at this point 
Solved Threads: 0
seekerems seekerems is offline Offline
Newbie Poster

Re: visual basic

 
0
  #5
Jan 9th, 2007
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=)
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 5
Reputation: seekerems is an unknown quantity at this point 
Solved Threads: 0
seekerems seekerems is offline Offline
Newbie Poster

Re: visual basic

 
0
  #6
Jan 9th, 2007
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=)
Reply With Quote Quick reply to this message  
Join Date: Jun 2006
Posts: 7,651
Reputation: ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of ~s.o.s~ has much to be proud of 
Solved Threads: 474
Super Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Failure as a human

Re: visual basic

 
0
  #7
Jan 9th, 2007
How about something simple like (this code is not tested, use it just as a sample)

Your form structure:
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.
I don't accept change; I don't deserve to live.

Jo Tujhe Jagaaye, Nindein Teri Udaaye Khwaab Hai Sachcha Wahi.
Nindon Mein Jo Aaye Jise To Bhul Jaaye Khawab Woh Sachcha Nahi.
Khwaab Ko Raag De, Nind Ko Aag De
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 5
Reputation: seekerems is an unknown quantity at this point 
Solved Threads: 0
seekerems seekerems is offline Offline
Newbie Poster

Re: visual basic

 
0
  #8
Jan 10th, 2007
thank you very much, this will help me a lot...
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum


Views: 1411 | Replies: 7
Thread Tools Search this Thread



Tag cloud for Visual Basic 4 / 5 / 6
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC