Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old October 25th, 2005, 11:16 PM
dt_aiying dt_aiying is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 93 dt_aiying User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 58 m 8 sec
Reputation Power: 4
Arrow VB Login

Hi,

I know this is a relatively simple thing to do, but I can't manage to figure this out. I really need help.

I am to design a VB login form for my system. Everything else is done, except for ensuring that a valid user has logged in to the system. A table in a database keeps all the user information (Login ID, Password, etc). How do I do this?

Thanks very much for any help.

Reply With Quote
  #2  
Old October 25th, 2005, 11:35 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
You need a form to get the username/password, then you need code that tests that username/password against the database values and proceeds if the validation tests succeed.

It's pretty simple but not trivial, try a google search or search this forum.
__________________
======
Doug G
======
I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain

Reply With Quote
  #3  
Old October 27th, 2005, 06:04 AM
dt_aiying dt_aiying is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 93 dt_aiying User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 58 m 8 sec
Reputation Power: 4
Thanks for the advice.

I coded the lines below for my cmdLogin command button in the login form, but a run-time error 91 was generated when a user presses the cmdLogin button. The error occured at the "Do Until .EOF" line. What could be wrong? I've checked this several times already, but I still cannot find the fault behind this.
What do I do now? I really need help here.

Here's the code lines.

Quote:
Private Sub cmdLogin_Click()

Dim usrname As String
Dim psword As String
Dim Msg As String

usrname = Trim$(txtUserName.Text)
psword = Trim$(txtPassword.Text)

With adoLogin.Recordset
Do Until .EOF

If .Fields("UserName").Value = usrname And .Fields("Password").Value = psword Then

'frmLogin.Hide
'frmMain.Show

'This is for testing purposes only
Label1.Text = "You have successfully logged in."

Exit Sub

Else

.MoveNext

End If

Loop
End With

Msg = MsgBox("Invalid Login. Please try again.", vbOKCancel)
If (Msg = 1) Then

frmLogin.Show
txtUserName.Text = ""
txtPassword.Text = ""

Else

End

End If

End Sub

Reply With Quote
  #4  
Old October 28th, 2005, 12:26 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
Where are you creating the adologin recordset?

Also you should try stepping through your vb code with the debugger, usually you can easily find the cause of code errors.

Reply With Quote
  #5  
Old October 30th, 2005, 07:53 PM
dt_aiying dt_aiying is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 93 dt_aiying User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 58 m 8 sec
Reputation Power: 4
The adoLogin recordset is created in this VB login form itself (not in other separate forms).

I've tried using the debugger and it says the error occured at the "Do Until .EOF" line. Can't figure out what is wrong about this one.

Please help.

Reply With Quote
  #6  
Old October 30th, 2005, 08:32 PM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
The error indicates you don't have a recordset object. Double check the adodc control (if that's what you're using). Maybe your recordsource is incorrect in the control.

Reply With Quote
  #7  
Old October 30th, 2005, 10:53 PM
dt_aiying dt_aiying is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 93 dt_aiying User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 58 m 8 sec
Reputation Power: 4
Yes, I'm using ADO data control for this VB login form.
I've double-checked the recordsource for this adoLogin and all settings are correct.

What could be wrong?

Please help.

Thanks very much once again.

Reply With Quote
  #8  
Old October 31st, 2005, 12:13 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
Use the debugger to isolate the problem.

Reply With Quote
  #9  
Old November 2nd, 2005, 01:59 AM
dt_aiying dt_aiying is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 93 dt_aiying User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 58 m 8 sec
Reputation Power: 4
Dear Doug,

Thanks for the much help given.

I've found out that I would need to create two TextBoxes, one for holding the UserName and another for holding the Password. These two Textboxes are not visible and have their data members' values set to the ADO Data Control with their data fields' values set accordingly. Then only was I able to run the login program successfully.

However, this login form that I've been working on for so many days here is interacting with an MS Access database for testing purposes.

Actually I am to create a login form for my Virus Scan Tracking Maintenance System, which is to connect with the MS SQL Server 2000 database.

When I tried out the coding (like the one posted earlier) and made the necessary changes / adjustments, I have this message (before the program execution): "SELECT permission denied on column 'Password' of object 'table_Login'."

And, upon pressing the Login button, I have the same error (like before) and this error occured at the line "Do Until .EOF".

What should I do now? I think I am not supposed to interact directly with the SQL Server database for this particular table, because its Password column is protected? (The password in the table is of the varbinary datatype.)

I really need help here. I've been working on this for a long time already.
How can I proceed now? Any help at all is much appreciated.
Thanks very much.

Reply With Quote
  #10  
Old November 2nd, 2005, 02:24 AM
Doug G Doug G is offline
Grumpier Old Moderator
ASP Free God 11th Plane (10000 - 10499 posts)
 
Join Date: Sep 2003
Posts: 10,143 Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level)Doug G User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Weeks 4 Days 23 h 19 m 36 sec
Reputation Power: 181
The error you posted is coming from the database, not VB.

Start by looking in Books Online (BOL) for sql server. There is a lot to sql server access permissions.

Maybe try asking in a sql server forum.

Reply With Quote
  #11  
Old November 8th, 2005, 09:22 AM
dt_aiying dt_aiying is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 93 dt_aiying User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 58 m 8 sec
Reputation Power: 4
Thanks a lot for the much help given, Doug.

I've just managed to get my login codes done yesterday. I've also changed much of my coding to adjust to the SQL Server database settings.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > VB Login


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT