stored procedures and transactions in access

fguihen

Well-known member
Joined
Nov 10, 2003
Messages
248
Location
Eire
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.
 
I think youre best bet (because IIRC Access doesnt support transactions, and even if it did, in this case its a bad design), is to use a DataSet. If youre 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 theyre 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.
 
Back
Top