INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Log-in form errors

Log-in form errors

(OP)
Hello

I am trying to create a simple log-in page but I am getting three green 'underlines' on this line:

CODE -->

Dim sql As String = "SELECT * FROM university WHERE strEmail = '" & strEmail & "' AND [password] = '" & password & "'", ConnectionString 

The errors are under

1)

CODE -->

& strEmail & 
(Used before assigned a value).
2)

CODE -->

& password & 
(Used before assigned a value).
3)

CODE -->

ConnectionString 
(No 'As' clause, object assumed)

When I have tried to change 'ConnectionString' to 'conn', I just get other errors.

The page loads in my browser, but I would prefer tidy code. The rest of my code looks like this where the log-in form has two fields strEmail (Email field) and password (Password field):

CODE --> VB.NET

Using conn As OleDbConnection = New OleDbConnection(System.Configuration.ConfigurationManager.ConnectionStrings("students").ConnectionString)

                Dim strEmail As String
                Dim password As String

                Dim sql As String = "SELECT * FROM university WHERE strEmail = '" & strEmail & "' AND [password] = '" & password & "'", conn

                Dim cmd As New OleDbCommand(sql, conn)

                conn.Open()

                Dim dr As OleDbDataReader = cmd.ExecuteReader

                Dim strEmailFound As Boolean = False

                Dim passwordFound As Boolean = False

                'if in database:

                While dr.Read

                    strEmailFound = True

                    strEmail = dr("strEmail").ToString

                    passwordFound = True

                    password = dr("password").ToString

                End While

                conn.Close() 

Thank you.

RE: Log-in form errors

When you hover over the green lines, what is it saying?
There are obviously not compilation errors, just warnings.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close