Problem Adding Rows with fpSpread v6.0.0.55 and DAutoSave=False in VB6

  • workaholic 9 years, 1 month ago

    Ok, a question on saving…

    I have a fpSpread control on a form, that is bound to a mdb database.  I’ve selected all the rows from one table, and they display in the spread.

    I’ve set the DAutoSave=False, and the user has a 'SAVE’ button that runs the DataSave method.

    I’ve also added a few extra rows to the spread, for new records, by setting the .maxrows = fpSpread.DataRowCnt +5

    When I add a new record to the first blank row, and click on save, the new record does not get written to the database – if I exit and re-start the program, I can see the record does not exist in the spread.  I also checked the mdb file, and the record is not there either.

    In the save subroutine, if I loop thru the columns in the row and set the .setcelldirtyflag to true for each cell before I save, when I save, the new record is there, but the record in the previous row of the spread is also updated with the same information.

    Does anyone have any suggestions?  Or, does anyone have a sample program that can has an add and delete working with a bound fpSpread control?  I’m really at a loss here…

    Thanks,

  • scotts FP 9 years, 1 month ago

    E,

    Adding rows to the Spread and having the user type in them and click a button to call DataSave, should save the new row to the bound database. If you are programatically putting data in the Spread, then you would need to call the SetCellDirtyFlag method for each cell you programatically changed (or the -1 column) and then call DataSave to save the changes for that row. But, this should not change the previous row’s data. Could you attach a small zipped project reproducing the problem you are seeing for us to debug this issue?

  • workaholic 9 years, 1 month ago

    I started fresh with a clean project, and it is working fine now.  I did change my setcelldirtyflag call to use the -1 for the row…  originally I was looping thru each cell in the row and setting the dirty flag.

    I’m not sure what else I did – maybe just starting fresh cleared out some garbage code I had…

    Thanks,

    E.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.