3 Replies - 310 Views - Last Post: 28 July 2011 - 06:50 AM Rate Topic: -----

#1 Bong89  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 16-July 11

there is a debug in log in form.,pls help how could i fixed it.

Posted 27 July 2011 - 09:58 PM

below the str which rs.Open(str, conn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic) there is a debug on it,.please what should i do? thanks a lot.,.
Dim rs As New ADODB.Recordset
    Dim count As Integer
    Dim constr As New ADODB.Connection

    Private Sub OK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OK.Click
        str = "Select * from admin where username = '" & UsernameTextBox.Text & "'"
        rs.Open(str, conn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
        count = 0
        On Error Resume Next
        Do While Not rs.EOF
            count += 1
            rs.MoveNext()
        Loop
        rs.MoveFirst()
        On Error GoTo 0
        If count = 0 Then
            MsgBox("Unregistered username")
            UsernameTextBox.Clear()
            PasswordTextBox.Clear()
            UsernameTextBox.Focus()
            rs.Close()
            Exit Sub
        Else
            If PasswordTextBox.Text = rs.Fields(1).Value Then
                UsernameTextBox.Clear()
                PasswordTextBox.Clear()
                MsgBox("Logged In")
                main.Show()
                conn.Close()
                Me.Hide()
            Else
                MsgBox("Incorrect Password")
                UsernameTextBox.Clear()
                PasswordTextBox.Clear()
                UsernameTextBox.Focus()
                rs.Close()
            End If
        End If
    End Sub

    Private Sub Cancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel.Click
        Me.Close()
    End Sub

    Private Sub LoginForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        conn = getconnect()
        conn.Open()
    End Sub
    Public Sub ref()
        conn = getconnect()
        conn.Open()
    End Sub

End Class

This post has been edited by modi123_1: 27 July 2011 - 10:03 PM
Reason for edit:: please use code tags


Is This A Good Question/Topic? 0
  • +

Replies To: there is a debug in log in form.,pls help how could i fixed it.

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9277
  • View blog
  • Posts: 34,780
  • Joined: 12-June 08

Re: there is a debug in log in form.,pls help how could i fixed it.

Posted 27 July 2011 - 10:03 PM

What do you mean "there's a debug on it"?
Was This Post Helpful? 0
  • +
  • -

#3 Bong89  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 16-July 11

Re: there is a debug in log in form.,pls help how could i fixed it.

Posted 27 July 2011 - 10:21 PM

yes when i start running the program which the log in form of the inventory then the debug will occur when i enter the correct username and password. this was given by my friend to study this inventory but there is a problem when i start to run it..,.
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9277
  • View blog
  • Posts: 34,780
  • Joined: 12-June 08

Re: there is a debug in log in form.,pls help how could i fixed it.

Posted 28 July 2011 - 06:50 AM

There's an error? An exception? Debug is more of a process of stepping through the code to remove a bug (hence *DE*bug). What exception are you getting?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1