Skip to main content
Participating Frequently
May 9, 2006
Question

Update an Access table

  • May 9, 2006
  • 1 reply
  • 700 views
I'm working on a Cf inteface where a user can push a button and process an Access table. I'm running into issues where the data is being inserted (INSERT statement) into the Access table, however the data isn't inserted into the last/new row in the table. It ends up between some existing rows in a database.

I run a delete statement on some data in the table before I run the insert and new row is always in the row where the data was deleted.

Is there anyway I can make the INSERT go to the last row in the database?

This topic has been closed for replies.

1 reply

May 9, 2006
The "last row of the database" is kind of subjective. Do you have an autonumber field? If you do, sort on it and your new row will appear as the last row.
FrecAuthor
Participating Frequently
May 9, 2006
Thanks. I do have an autonumber field.

Would I add the sort (ORDER BY)? On my insert statement?
Participating Frequently
May 9, 2006
What jdeline is trying to tell you is that first/last is meaningless in terms of data in a database table, since it isn't "stored" in any particular order. This doesn't work like a spreadsheet. Is this just an issue as to what it looks like when selected in a query, because you would control that with an ORDER BY clause where you would specify which field(s) to sort on and whether you wanted descending or assencding.

In other words, why does it matter to you where this row is inserted into the table, especially if you are using an auto-incremented primary key?

Phil