using "Insert Into" sql statement for access2000 using ado/vb6

I have a simple question?  Using the sql statement "Insert Into" for access 2000 mdb using ado in vb6 program, is the row (record) always inserted at the end of the table, i.e. after the last physical row in the table prior to the insertion?  

Morris
morrisboAsked:
Who is Participating?
 
leonstrykerConnect With a Mentor Commented:
The simple answer is yes, but it depends on the Index. Why is this important?

Leon
0
 
morrisboAuthor Commented:
In a subsequent query I may want to either overwrite the last entry or add an additional record, depending on the contents of the previous last record added. (using ado's recordset.movelast).  This way I don't have to analyze every row.  I know I could index certain fields, then look directly for the previously entered record, but it seems simpler to just look for the last record.  

Actually, I am storing a "balance forward" type record from a commission statement.  If the commission statement is run more than once during the same month, I need to just update the last record, otherwise I need to "insert" a new record, indicating that I am dealing with a later month "brought forward" record from the previous month. Hope that makes sense.

It is a good question.  I am new at using sql and just want to keep it simple.

Thanks

Morris
0
 
leonstrykerCommented:
>Hope that makes sense

Yes, but no. You can not rely on the positioning to modify your data. There is nothing that will guaranty it.  Instead you need to use a unique identifier, most likely you primary key, to make sure you are dealing with the correct record.

Leon
0
 
morrisboAuthor Commented:
Leon,

Thanks,

I can do that.

Morris
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.