Strange problem while updating

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cmrhema
    Contributor
    • Jan 2007
    • 375

    Strange problem while updating

    Hello All
    I am having a peculiar problem. I am using vb6.0 backend sql server and ado connection.
    I can insert records, delete and modify records.
    My table is called investmentdetai ls it consists of
    field/datatype/length
    fdno char 25
    fholder char 20
    and many others.
    While modifying a record I use a combo box which consists of fdno . I populate using add item method. While using the keyup event of combo box all the fields gets displayed along with the respective fdno.
    One of the fdno has the value 227703000000825 9.
    The record has been properly inserted.
    It can be modifed as well as deleted.
    But the problem occurs when I modify some fdno
    When I update(modify and save) I have an error stating
    Runtime error 2147467259 (80004005)
    The conversion value of 227703000000825 9 overflowed an int column. Maximum integer value exceeded.

    Whereas there is no problem is modifying and saving other records


    WHY IS IT THAT I CAN MODIFY AND UPDATE SOME BUT NOT OTHERS
    PLEASE HELP ME OUT OF THIS MESS

    THANKS
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    Originally posted by cmrhema
    Hello All
    I am having a peculiar problem. I am using vb6.0 backend sql server and ado connection.
    I can insert records, delete and modify records.
    My table is called investmentdetai ls it consists of
    field/datatype/length
    fdno char 25
    fholder char 20
    and many others.
    While modifying a record I use a combo box which consists of fdno . I populate using add item method. While using the keyup event of combo box all the fields gets displayed along with the respective fdno.
    One of the fdno has the value 227703000000825 9.
    The record has been properly inserted.
    It can be modifed as well as deleted.
    But the problem occurs when I modify some fdno
    When I update(modify and save) I have an error stating
    Runtime error 2147467259 (80004005)
    The conversion value of 227703000000825 9 overflowed an int column. Maximum integer value exceeded.

    Whereas there is no problem is modifying and saving other records


    WHY IS IT THAT I CAN MODIFY AND UPDATE SOME BUT NOT OTHERS
    PLEASE HELP ME OUT OF THIS MESS

    THANKS
    the number 227703000000825 9 is probably bigger than the max value your system can store as an int. Would it be possbile to change the properties of that column to a double instead of an int, or even a long

    Comment

    • cmrhema
      Contributor
      • Jan 2007
      • 375

      #3
      Originally posted by markmcgookin
      the number 227703000000825 9 is probably bigger than the max value your system can store as an int. Would it be possbile to change the properties of that column to a double instead of an int, or even a long
      But I have stored it as char and length as 25

      Comment

      • cmrhema
        Contributor
        • Jan 2007
        • 375

        #4
        Originally posted by cmrhema
        But I have stored it as char and length as 25

        Resolved the problem folks.
        This is the way I retrieve the data in combo keyup event

        MyRs3.Open "select * from investmentdetai ls where fdno ='" & Trim(cbFDNO.Tex t) & "' and type='Fixed'", MyCon, adOpenDynamic, adLockOptimisti c

        I update in command button click event as below

        MyRs1.Open "select * from investmentdetai ls where fdno =" & Trim(cbFDNO.Tex t), MyCon, adOpenDynamic, adLockOptimisti c


        I FORGOT the ' quotes in the query near the trim function.
        Hence the problem

        Next time before posting I will be careful

        Any way thanks

        Comment

        • willakawill
          Top Contributor
          • Oct 2006
          • 1646

          #5
          Well great that you worked it out and thanks for posting the solution which will be an great help for anyone following this thread

          Comment

          Working...