I'm looking for a good way to swap to records within a recordset. When I've tried the traditional way of swapping I get an access violation error becuase of duplicate primary keys.
Printable View
I'm looking for a good way to swap to records within a recordset. When I've tried the traditional way of swapping I get an access violation error becuase of duplicate primary keys.
What's the "traditional" way?
Just the traditional swap algorithm
this would swap var1 with var 2
temp = var1
var1 = var2
var2 = temp
I just used this concept exept used loops to copy all the fields into temp arrays. The problem is, there is a stage where var1 and var2 are equal, the database doesn't like this since the primary keys are the same.
How about reading the data into a program array, deleting the data from the database, and then writing the data back in the desired order?
I would need to delete both records before I could write any data, so if I added new records wouldn't they just be at the end of the recordset?
They will be stored in Key order.