Can't seem to update all the fields in database

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

    Can't seem to update all the fields in database

    here i have attached a file see the file and i want code for that form urgent
    Attached Files
  • iam_clint
    Recognized Expert Top Contributor
    • Jul 2006
    • 1207

    #2
    ok what is in this file i opened it no virus's found on it but no file extension what exactly is the problem and wheres the code.

    Comment

    • kumar_ps
      New Member
      • Apr 2006
      • 19

      #3
      Private Sub Command1_Click( )
      On Error Resume Next
      If Trim(Text3.Text ) = Trim(Text4.Text ) Then

      If (Trim(Text1.Tex t) = Trim(rs.Fields( 0))) And (Trim(Text2.Tex t) = Trim(rs.Fields( 1))) Then

      rs!pwd = Trim(Text3.Text )
      rs.Update
      MsgBox "Password change successfully"
      Text1.Text = ""
      Text2.Text = ""
      Text3.Text = ""
      Text4.Text = ""
      Else
      GoTo level1
      End If
      Else
      level1:
      MsgBox "Please correct Password"
      Text2.Text = ""
      Text3.Text = ""
      End If
      End Sub


      i am using this code changing password its ok but it is changing first field only in database when u enter 2nd o 3d field it shows error
      1st field mean userids in my table ADMIN,POWER and USER are the users when i change ADMIN its ok but when i enter power or use it shows error


      please see and responce to me as soon as posible if posible come to chat
      koti_bujji1@yah oo.com


      Thanks

      Comment

      • sashi
        Recognized Expert Top Contributor
        • Jun 2006
        • 1749

        #4
        hi kumar,

        take a look at tutorial 2.. take care..

        Last edited by sashi; Jul 29 '06, 03:00 PM.

        Comment

        • mkfaiz
          New Member
          • Jul 2006
          • 1

          #5
          Originally posted by iam_clint
          ok what is in this file i opened it no virus's found on it but no file extension what exactly is the problem and wheres the code.
          THE MAIN PROBLEM WITH THE CODE YOU ARE FETCHING ALL THE RECORDS FROM TEH DATABASE

          YOU HAVE TO CHOOSE ONLY ONE.

          BY USEING
          RS.FILTER = "UserID = " & trim(text1.text )
          if it return something.
          you can update it
          else
          there is no user at the name
          simple

          Comment

          • Mahesh_Bote
            New Member
            • Jul 2006
            • 26

            #6
            Originally posted by mkfaiz
            THE MAIN PROBLEM WITH THE CODE YOU ARE FETCHING ALL THE RECORDS FROM TEH DATABASE

            YOU HAVE TO CHOOSE ONLY ONE.

            BY USEING
            RS.FILTER = "UserID = " & trim(text1.text )
            if it return something.
            you can update it
            else
            there is no user at the name
            simple


            why u don't try this

            RecordSet.Open "Update <Table Name> Set = <Ur Field> <Where Criteria>", <Conn>, <Dynamic>, <Batch Optimistic>

            Comment

            • saravananp77
              New Member
              • Jul 2006
              • 1

              #7
              dear friend

              how do hide column in datagrid control or dbdatagrid control in vb6.0
              pls help me

              Comment

              • Niheel
                Recognized Expert Moderator Top Contributor
                • Jul 2005
                • 2432

                #8
                kumar_ps,

                You should state your question in the first post and also when asking for help choose better titles for your thread. "Urgent Help" is not a good title.

                - KUB
                niheel @ bytes

                Comment

                • sashi
                  Recognized Expert Top Contributor
                  • Jun 2006
                  • 1749

                  #9
                  Hi Kumar,

                  what is so urgent my fren?? everyone is rushing for something almost every second.. so.. be relax.. pls state your problem clearly so some will be able to help out faster.. if possible post the portion of the code segment that is triggering error.. take care my fren.. :)

                  follow the steps below
                  1st - problem statement
                  2nd - steps taken to overcome the problem
                  3rd - code segment or error message/number that will be useful for troubleshooting
                  4th - follow-up your post for any response

                  it's much easier to slove problem in this way.. this is only my suggestion.. take care.. :)

                  Comment

                  Working...