fguihen Posted November 6, 2005 Posted November 6, 2005 i have a large amount of details to take in off a form. im splitting it over 4 or so forms. i have to use an access database for this as its for a person using their own laptop and they wont purchace SQL Server. because the data is gathered over 4 or so forms, i think it would be very handy to use a stored procedure or transaction and if they cancel on the 4th form then no data would be stored. can this be done with access, or can anyone think of a way to accomplish this. il be using c# & .NET v1.1 as my coding platform. Quote
bri189a Posted November 8, 2005 Posted November 8, 2005 I think you're best bet (because IIRC Access doesn't support transactions, and even if it did, in this case it's a bad design), is to use a DataSet. If you're dataset has the original records, as you modify them the rows will change to 'changed' or 'added' or 'deleted'. Then if you want things to be really easy, you just have a data adapter that has the correct UPDATE, DELETE, and INSERT commands and when they're ready to save you do a DataAdapter.Update() method which will call the proper stored procedure for each row that has a state change. Prior to that anytime before they hit save they can cancel changes for a row or for everything (this is done by DataSet.RejectChanges()...) but any changes they have made up until that point will appear to the user to be saved because the dataset holds the current changes until they save to the database (the data adapter will do DataSet.AcceptChanges() when it is completed (successfully) doing the Update() method). DataSets are a perfect fit for this kind of issues - working with disconnected data and only updating the data store at a designated time. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.