|
-
Aug 10th, 2000, 09:48 AM
#1
Thread Starter
Member
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.
-
Aug 10th, 2000, 09:53 AM
#2
What's the "traditional" way?
-
Aug 10th, 2000, 10:07 AM
#3
Thread Starter
Member
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.
-
Aug 10th, 2000, 10:11 AM
#4
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?
-
Aug 10th, 2000, 10:16 AM
#5
Thread Starter
Member
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?
-
Aug 10th, 2000, 10:32 AM
#6
They will be stored in Key order.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|