Runescope
Well-known member
- Joined
- Jan 6, 2011
- Messages
- 53
- Programming Experience
- Beginner
Greetings,
I have an unbound Access Database that I'm trying to fill with almost 20 years of data stored in text files. Each file is one day's prices of items, each file has around 10,000 different items. Sometimes the name of the item changes slightly, and I want to write that change into the database along with what date the change was made.
I should probably mention that I'm working in VB.Net (Visual Studio 2010 Ultimate)
Okay, so what's happening is that when I go to update, I get the error: "Concurrency Violation: The Updatecommand affected 0 of the expected 1 records force change"
I know that the problem is that the PREVIOUS change I made to the database for that item hasn't been saved, and now I'm writing ANOTHER change, and it's throwing an error. Which makes sense. I know one way to resolve this is to uncomment the line that clears and reloads the data into the dataset and datatable. I've tried it and it works just fine.
However, it REALLY slows down the process, and it's going to keep getting slower and slower as more and more data is stored in the database. There are over 3000 days of information to go through, so the faster I can make it the better.
So my question is, is there some way to force the database to accept the most recent changes without reloading the entire database?
Thank you for your time and attention to this question. I can't think of anything to add, but feel free to answer questions.
I have an unbound Access Database that I'm trying to fill with almost 20 years of data stored in text files. Each file is one day's prices of items, each file has around 10,000 different items. Sometimes the name of the item changes slightly, and I want to write that change into the database along with what date the change was made.
I should probably mention that I'm working in VB.Net (Visual Studio 2010 Ultimate)
VB.NET:
If Val(UpDate) > Val(FFoundRow(0)("UpDate")) Then ' FFoundRow is a Datarow for that specific item
FFoundRow(0)("FName") = FName ' always making sure the name is updated
FFoundRow(0)("UpDate") = UpDate ' the most recent date
FDA.Update(FDT) : FDT.AcceptChanges() ' I have switched these two about, with no difference.
'FDS.Clear() : FDA.Fill(FDS, "Fund Info") : FDT = FDS.Tables("Fund Info") ' Commented out, I'll explain below.
End If
Okay, so what's happening is that when I go to update, I get the error: "Concurrency Violation: The Updatecommand affected 0 of the expected 1 records force change"
I know that the problem is that the PREVIOUS change I made to the database for that item hasn't been saved, and now I'm writing ANOTHER change, and it's throwing an error. Which makes sense. I know one way to resolve this is to uncomment the line that clears and reloads the data into the dataset and datatable. I've tried it and it works just fine.
However, it REALLY slows down the process, and it's going to keep getting slower and slower as more and more data is stored in the database. There are over 3000 days of information to go through, so the faster I can make it the better.
So my question is, is there some way to force the database to accept the most recent changes without reloading the entire database?
Thank you for your time and attention to this question. I can't think of anything to add, but feel free to answer questions.