Results 1 to 10 of 10

Thread: update error RESOLVED

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    update error RESOLVED

    "Either BOF or EOF is True, or the current record has been deleted.REquested operation requires a current record"

    i have a datagrid...when i am testing the update option it seems to no longer be wrking. Basically i can a new row to the datagrid and want to save that....

    i rs.addNew until the rs.RecordCounter = length off datagrid then
    i copy what is in the 1st row of the datagrid to the rs and then rs.Update
    rs.MoveNext until i copy them all.... but now it just gives me the above error after copying the 1st row
    Last edited by pame1la; Apr 5th, 2005 at 10:46 AM.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    Re: update error

    how do i get top start at from the top of the rs nd work down bcos it is pointing at teh added line, and therefore thinks it EOF after copying line 1 and unable to copy the next lines!!!!

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    Re: update error

    Do While Counter < (datagrid no of rows)
    rs.AddNew
    Counter = Counter + 1
    Loop

    am i allowed to add a blank line in a rs or do i ned to go depending on if columns r allowed nulls???

  4. #4
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: update error

    If some columns in your table are set as allownulls=false then you wouldnt be allowed to add an 'empty' record/row.

    Perhaps you could make a clearer explanation of your problem so members here will be able to help you.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    Re: update error

    Quote Originally Posted by dee-u
    .

    Perhaps you could make a clearer explanation of your problem so members here will be able to help you.

    sorry.... right i have an update option where the user searches for product and then updates it and saves it bak to the dbase...

    Some of the data is held in a datagrid and the user is allowed to add new lines. This is what I am having a problem with... when the user updates by adding a new line on the record i am unable to save the new line into the dbase... and am getting errors.....

    I have now ensured that any new added lines are no longer balnk but Im still getting an error,

    "key column information is insufficient or incorrect. Too many rows will be affected by update"

    what does that mean?????

  6. #6
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: update error

    I believe you violated rules in your columns like you inputted a 10 character string to a column which is defined with a size type as 7, etc... I just tried it and I also encountered the same problem with the situation I stated above.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    Re: update error

    mostly all the datatypes in the grid are money and the rest are int....

    i only enter numbers so i not sure y its got this error!!!

  8. #8
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: update error

    Try to use the DataForm Wizard and emulate what you intend to do... Or perhaps you could post your attach your project (including database) so we could take a look at the problem....
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2005
    Posts
    334

    Re: update error

    that error appears on rs.MoveNext...... uodate hasn't even occured yet so y is it coming up wiv that error???

  10. #10
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: update error RESOLVED

    You have already reached the end of the recordset and yet you are still trying to movenext....

    Here is an example of looping through a recordset....
    VB Code:
    1. Do while not recordset.eof
    2. recordset.movenext
    3. loop
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

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