Click here to Skip to main content
15,895,656 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
...Hello everyone!
..i am new at this and is very hard to understand it, for some of you is very obvious but for me its hard to build the code,can you help me plz, i will appreciated.

VB
Dim nome As Object

        name = Database.ExecuteScalar("SELECT a.name FROM users a   WHERE a.coduser = :pLogin and a.password = :pPassword" _ , myParamArray)
        Dim a As String      
        Dim b As String
        Dim errlist As String
        Try

            If Not name Is Nothing Then
                MsgBox("Welcome " & name.ToString & "!")
            Else
                 errlist
            End If

            Select Case errlist
                Case 1
                    If name = "" And passid = "" Then
                        MsgBox("enter the name and password")
                    End If
                Case 2
                    If name <> a Then
                    MsgBox("the name you entered does not exist, please enter a valid name.")
                    End If
                Case 3
                    if pass<> nome,b then
                    MsgBox("the password is incorrect")
                    End If
                Case 4
                    If name <> a And passid <> b Then
                   MsgBox("the user and password are incorrect, please insert again.")
                  End If
                Case 5
                    If DataBase = 0 Then
                    MsgBox("DB currently unavailable")    
                  ElseIf  Database = 1 Then
                        'works
                    End If

            End Select

        Catch ex As Exception
            MessageBox.Show("Error establishing a database connection:" + ex.Message)

        End Try
Posted
Updated 29-Apr-13 1:51am
v3

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900