Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Pro Visual Basic 2005
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Pro Visual Basic 2005 For advanced Visual Basic coders working in version 2005. Beginning-level questions will be redirected to other forums, including Beginning VB 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Visual Basic 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old June 15th, 2007, 08:39 PM
Authorized User
 
Join Date: Feb 2004
Location: , CT, USA.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dparsons, you're very kind to try to keep helping airjaws, but I think he's not going to get it. He should read his vb.net book(s) and hang out in the beginner's forum for a while.

  #12 (permalink)  
Old June 16th, 2007, 10:17 AM
Authorized User
 
Join Date: Jun 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes, he is very kind to try to help me, and you are too. yes, im beginner, but i dont have time to study whole book, this stuff has to be done by wednesday or im doomed :(

  #13 (permalink)  
Old June 16th, 2007, 11:58 AM
Authorized User
 
Join Date: Feb 2004
Location: , CT, USA.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, you're doomed, then. There are many competent consultants your boss can hire to write this code. As always, good luck.

  #14 (permalink)  
Old June 17th, 2007, 01:24 AM
Authorized User
 
Join Date: Jun 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

lol its not boss. its the project that ive got from my teacher at university altough ive never seen VB before for some odd reason he gave me assigment in it for signature. here in croatia when you listen class at university you get signatures from professor. i was that luck to get this project btw...

it should look like this or not?:
Dim check As ???
check = ????????("select [password] from [tablename] where [login] = 'txtLogin.Text'")
If check= txtPass.Text Then
frmMain.Show()
Else
MsgBox("access dinied")
End If

am i near solution? what to put instead of those questionmarks. if ive used access database i would put recordset, but what if i use sql database instead, as i said before?
is it so difficult to help?



  #15 (permalink)  
Old June 17th, 2007, 07:47 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

My first post was not meant to be a cure all to solve your problem, it was meant to show you the logic behind doing something like this.

If that is the select statement you are using, you can do something like this: SELECT Count([password]) from table where login = '" & txtLogin.Text &"'"

And then use ExecuteScalar() to execute the query against your database and, by doing this, it will return you the value of Count. If that value is 0 you know that an invalid login was provided, else it was correct.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
  #16 (permalink)  
Old June 17th, 2007, 08:49 PM
Authorized User
 
Join Date: Jun 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you very much

  #17 (permalink)  
Old June 18th, 2007, 09:22 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

XPost Conversation
http://p2p.wrox.com/topic.asp?TOPIC_ID=61843

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
  #18 (permalink)  
Old June 19th, 2007, 01:57 PM
Authorized User
 
Join Date: Jun 2007
Location: , , .
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dparsons sorry for spamming the forum. FINALLY, i've reached solution. it was similar to my second post in this thread. so basically it looks like this:

        Dim counter As Integer
        Dim check As Boolean = False

        counter = Me.DataSet.table_name.Rows.Count

        For i As Integer = 0 To counter - 1

            If Me.DataSet.table_name.Rows(i).Item("login") = txtLogin.Text And Me.DataSet.table_name.Rows(i).Item("pass") = txtPass.Text Then
                check = True
                frmMain.Show()
                Exit For

            End If
        Next i

        If check = False Then MsgBox("Wrong login name or password! Access dinied!")

thanx everyone for trying to help.


  #19 (permalink)  
Old June 19th, 2007, 04:21 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Depending on your query you could just do

If counter = 0 Then
MsgBox("Wrong login name or password! Access dinied!")
Else
frmMain.Show()
End If

in any case glad you got it working.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
login and password airjaws Visual Basic 2005 Basics 5 June 18th, 2007 09:22 PM
Login Controls and Recover Password ~Bean~ ASP.NET 2.0 Professional 12 November 15th, 2006 03:13 PM
Login/Password Java application larry Apache Tomcat 2 December 20th, 2005 04:42 AM
Login with username and password morpheus Classic ASP Basics 4 November 19th, 2003 11:54 AM



All times are GMT -4. The time now is 03:09 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.