vb6.0 help urgent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kumar_ps
    New Member
    • Apr 2006
    • 19

    vb6.0 help urgent

    Private Sub Command1_Click( )
    On Error Resume Next
    If Trim(Text3.Text ) = Trim(Text4.Text ) Then
    rs.MoveFirst
    While Not rs.EOF
    If (Trim(Text1.Tex t) <> Trim(rs.Fields( 0))) And (Trim(Text2.Tex t) <> Trim(rs.Fields( 1))) Then
    MsgBox (" you are not existing user")
    Text1.Text = ""
    Text2.Text = ""
    End If
    rs.MoveNext
    Wend
    If rs.EOF Then
    rs.AddNew
    rs!pwd = Trim(Text3.Text )

    rs.Update
    MsgBox "Password change successfully"
    Text1.Text = ""
    Text2.Text = ""
    Text3.Text = ""
    Text4.Text = ""
    End If
    Else
    MsgBox "Please correct Password"
    Text3.Text = ""
    Text4.Text = ""
    End If
    End Sub


    i am using above code for change password here text1 is USEID text2 is OLDPASSWORD text3 is NEWPASSWORD and text4 is CONFIRMPASSWORD but it is not working



    Thanks
  • sashi
    Recognized Expert Top Contributor
    • Jun 2006
    • 1749

    #2
    Hi Kumar,

    please refer to below sample code segment..

    insert new record..
    Code:
      rs.AddNew
        .. do something here ..
      rs.Update
      rs.Close
      Set rs = Nothing
    update existing record..
    Code:
        .. do something here ..
      rs.Update
      rs.Close
      Set rs = Nothing
    if you notice properly.. rs.AddNew is only aplicable when it comes to inserting new data.. take care n good luck my fren.. :)

    kindly refer to the link attached below..

    Comment

    • kumar_ps
      New Member
      • Apr 2006
      • 19

      #3
      can u give me fully explanation about this one i am new to vb6.0






      Originally posted by sashi
      Hi Kumar,

      please refer to below sample code segment..

      insert new record..
      Code:
        rs.AddNew
          .. do something here ..
        rs.Update
        rs.Close
        Set rs = Nothing
      update existing record..
      Code:
          .. do something here ..
        rs.Update
        rs.Close
        Set rs = Nothing
      if you notice properly.. rs.AddNew is only aplicable when it comes to inserting new data.. take care n good luck my fren.. :)

      kindly refer to the link attached below..
      http://www.thescripts.com/forum/thread512359.html

      Comment

      Working...