• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Inserting data into an Access table

New Here ,
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

I'm working on a Cfinteface 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?
TOPICS
Advanced techniques

Views

410

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

How do you know what row into which it is going?
Why do you even care?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

Sounds like Frec is thinking of a database as just kind of a big old spreadsheet. Probably missing the entire point of relational database. It doesn't matter where the data is physically in the database because YOU control that on the output when you query for the data, etc. As Dan says, why do you even care where it goes in the table? If you want it to be the "virtual" last record, then make sure that the reecord is assigned the highest primary key value, etc. then you can query for the "last" record and even sort the records in the output last to first, first to last, etc.

Phil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

Let me break this down.

This is an Access database. The table is manipulated (via my ColdFusion app) and the data is exported via an Macro action. The export specification generates a text file of the table.

When I look at the table datasheet view I want it to be a snapshot of how the file will look (data rows,etc).

Does this help?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

Thanks, I'm trying to use it as temp spreadsheet. There is a autonumber column and I can verify it's assigning the next number. When I open the table everything is placed as the code parsed however this one line is sitting in the middle of my (access table) or wanna be spreadsheet. Ha.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

Yes, but wasn't the record assigned the next highest value in the autonumber field, so just ORDER BY that field in your query, and you will have your sorted list. Even if you are viewing this in Access via REPORTS, just put an order by statement in the query that drives your report (or form, etc.) (Wanting this to look that way in the datasheet view is kind of silly, when there are very simple ways to see it they desired way without having to do what you would need to do to actually reorder the data physically in a table.)

Phil

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 25, 2006 May 25, 2006

Copy link to clipboard

Copied

LATEST
quote:

Originally posted by: Frec
Thanks, I'm trying to use it as temp spreadsheet. There is a autonumber column and I can verify it's assigning the next number. When I open the table everything is placed as the code parsed however this one line is sitting in the middle of my (access table) or wanna be spreadsheet. Ha.

Build a select query in access and use that for your temp spreadsheet.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 24, 2006 May 24, 2006

Copy link to clipboard

Copied

The concept of first row and last row in a database table doesn't work. It is only important when you SELECT data and ORDER BY someField.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation