Is there a way to sepcify where (i.e. before or after current record, before or after record 3) to append a record?
Example:
record1 "Smith","1 Old Road"
record2 "James","23 The croxs"
record3 "Pet", "Hill av"
If the current record position is at record no3
insert befor should =>
add a new record between rec2 & 3
insert after should =>
add a new record after record 3.
I cannot use INSERT INTO as it always add to the bottom of the table.
I won't say it's not possible in a Jet/Access table (though I don't think it is), but you're breaking a cardinal rule of relational database theory, namely, that you should not assume a definite ordering of rows unless you use an ORDER BY clause.
The theoretically pure way to do this is to include a sequencing column by which you order. Actual sequence numbers don't work out too well, because even if you space them out (100, 200, 300 etc.), you can eventually run out of room between numbers. A little more effective is to use a floating point number. If you want to add a row between rows with sequence column values of A and B, just set its sequence column to (A+B)/2.
What is the objective of trying to physically order the rows. Is it by last name, timestamp, etc.? You can always return the rows in the order you desire by using an order by on your sql statment. In a realational db the physical order of the rows is not important in most cases.
I'm trying to create a structure of a database (Access) without using Access database along with some other field attributes not available in Access. RickSpr(MIS) given a possible answer using floating nos.
Is there another easy way of doing this (i.e. creating a random access file first & then copied every thing back?)
How can I create a random access file?
Thanks for your time.
NW
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.