Results 1 to 4 of 4

Thread: [RESOLVED] Cannot load data into database

  1. #1

    Thread Starter
    Hyperactive Member tommygrayson's Avatar
    Join Date
    Aug 2005
    Location
    In my Nissan Silvia
    Posts
    433

    Resolved [RESOLVED] Cannot load data into database

    Hi guys!

    I need your help once more. I cannot load data and I don't know why. Maybe there's something wrong with my code.

    VB Code:
    1. Private Sub cmdOK_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdOK.Click
    2.         'On Error GoTo ErrorTrapper
    3.         'UPGRADE_WARNING: Screen property Screen.MousePointer has a new behavior. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2065"'
    4.         System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
    5.         frmSplash.DefInstance.lblStatus.Text = "Processing Authentication..."
    6.         frmSplash.DefInstance.lblStatus.Refresh()
    7.         mUserID = Trim(UCase(txtUserName.Text))
    8.         mRole = Trim(UCase(cmbRole.Text))
    9.         mLevel = ""
    10.         Dbs.rscmdUserFile_Master.Open("SELECT * FROM SYSUSERFILE_MASTER WHERE USERNAME='" & UCase(Trim(txtUserName.Text)) & "'")
    11.         If Dbs.rscmdUserFile_Master.RecordCount <> 0 Then
    12.             If Dbs.rscmdUserFile_Master.Fields("ACTIVE").Value = True Then
    13.                 MsgBox("Username already in use.", 64, "Login Error")
    14.                 txtUserName.Focus()
    15.                 System.Windows.Forms.SendKeys.Send("{Home}+{End}")
    16.             Else
    17.                 If UCase(txtPassword.Text) = Trim(UCase(Dbs.rscmdUserFile_Master.Fields("PASSWORD").Value)) And UCase(txtUserName.Text) = UCase(Trim(Dbs.rscmdUserFile_Master.Fields("USERNAME").Value)) And UCase(cmbRole.Text) = UCase(Trim(Dbs.rscmdUserFile_Master.Fields("ROLE").Value)) Then
    18.                     mLevel = Dbs.rscmdUserFile_Master.Fields("ACCESS_LEVEL").Value
    19.                     Dbs.rscmdUserFile_Master.Close()
    20.                     Dbs.rscmdUserFile_Master.Open("UPDATE SYSUSERFILE_MASTER SET ACTIVE = '1' WHERE USERNAME='" & UCase(Trim(mUserID)) & "'")
    21.                     frmSplash.DefInstance.lblStatus.Text = "Login Succeeded..."
    22.                     frmSplash.DefInstance.lblStatus.Refresh()
    23.                     Me.Close()
    24.                     frmSplash.DefInstance.lblStatus.Text = "Finsished Initializing..."
    25.                     frmSplash.DefInstance.lblStatus.Refresh()
    26.                     frmSplash.DefInstance.Close()
    27.                     frmMain.DefInstance.Show()
    28.                     'MsgBox "Welcome to " & App.Title, 64, "Login Successful"
    29.                     'LoadComboLists
    30.                     'PassAccessRights
    31.                     'frmMain.mnuLogOff.Caption = frmMenu.mnuLogOff.Caption & " " & mUserID
    32.                 Else
    33.                     MsgBox("Invalid login credentials, try again!", 64, "Login")
    34.                     System.Windows.Forms.SendKeys.Send("{Home}+{End}")
    35.                 End If
    36.             End If
    37.             '      MsgBox "Invalid login credentials, try again!", 64, "Login"
    38.             '      txtPassword.SetFocus
    39.         Else
    40.             MsgBox("Username does not exist.", 64, "Login Error")
    41.             txtUserName.Focus()
    42.             '   txtPassword.SetFocus
    43.             System.Windows.Forms.SendKeys.Send("{Home}+{End}")
    44.         End If
    45.         If mLevel = "" Then
    46.             Dbs.rscmdUserFile_Master.Close()
    47.         End If
    48.         'UPGRADE_WARNING: Screen property Screen.MousePointer has a new behavior. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2065"'
    49.         System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default
    50. ErrorTrapper:
    51.         ErrorTrapperFunction(Me.Name)
    52.     End Sub
    Rate Me! Rate Me! Rate Me!

    Time to fly.

    Copyright GraysonSoft Inc. 2007

  2. #2

    Thread Starter
    Hyperactive Member tommygrayson's Avatar
    Join Date
    Aug 2005
    Location
    In my Nissan Silvia
    Posts
    433

    Re: Cannot load data into database

    Anyone please?

  3. #3
    PowerPoster
    Join Date
    Aug 2005
    Location
    College Station, TX
    Posts
    4,521

    Re: Cannot load data into database

    We would need more info... we need what error messages are showing, what line it is at, etc.. put a breakpoint at the start of that code, then step line by line (f11 i think) seeing the data as it changes, and where the errors are occurring....

  4. #4

    Thread Starter
    Hyperactive Member tommygrayson's Avatar
    Join Date
    Aug 2005
    Location
    In my Nissan Silvia
    Posts
    433

    Re: Cannot load data into database

    Thanks gigemboy for your response.

    I have figured out what really happened.

    VB .NET does not support data environment from VB 6.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width