473,406 Members | 2,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

BeginTrans, CommitTrans, Rollback in Datasheet (MS Access)

48
Hello,


I am using Datasheet view when displaying my data.
The data are displayed in a "x,y" matrix wherein data can be directly edited
in the Datasheet.

Anything inputted in a certain cell is directly updated to DB.
I want to open the Form, input data but WILL NOT COMMIT then close the Form.
If I open the same Form again, the data shouldn't be changed because it wasn't committed.

What I did was declare a global Workspace:
Expand|Select|Wrap|Line Numbers
  1.     Public WS As DAO.Workspace
  2.  
Then, instantiate it in the very first Form of the system:
Expand|Select|Wrap|Line Numbers
  1.     Set WS = DBEngine.Workspaces(0)
  2.  
In the loading of the Form w/c I want to control the DB update,
I started the db transaction setting:
Expand|Select|Wrap|Line Numbers
  1.     WS.BeginTrans
  2.  
In the said Form, I modified some data in the Datasheet.
For testing purposes, in my Close button click event, I made a rollback setting:
Expand|Select|Wrap|Line Numbers
  1.     WS.Rollback
  2.  
I did not commit the transaction.
But when I opened that Form again, the data was not rolled back to its old value.

What's wrong with this?
Aren't these BeginTrans, CommitTrans and Rollback work well with Datasheet?

Calling all Access Gurus...I badly need help.


-= keirnus =-
Aug 26 '09 #1
5 9830
FishVal
2,653 Expert 2GB
Could it be so that you update db via ADO connection?
Aug 26 '09 #2
keirnus
48
@FishVal
hmmm...it could be...

DAO and ADO are different, right?

Have to check it when I get back in the office tomorrow.

But, if DAO or ADO works, would it still be working for a Datasheet?
Could it be because I'm using Datasheet?

Coz I checked the net and there aren't any samples of Datasheet.
Aug 26 '09 #3
ADezii
8,834 Expert 8TB
Could be a simple Syntax Error (say that quickly 3 times!). Check the following Links:
http://bytes.com/topic/access/insigh...ion-processing
http://bytes.com/topic/access/insigh...rocessing-what
Aug 26 '09 #4
keirnus
48
I was able to make a test form.
I got a subform in Datasheet view in my form.
I set the Recordset of the form and executed the tests for Begintrans, CommitTrans and Rollback in DAO. All went well.

I implemented it in my system. But I can't edit the fields.

My guess is the query in my Recordset is using more than 1 table and the data displayed came from more than 1 table as well. Unlike in my test which I only used 1 table.

I tried 2 things:
[1]
I set the Recordset Type of my subforms
into "Dynaset (Inconsistent Updates)" but still wasn't able to edit the fields.
[2]
Instead of Recordset, I set the RecordSource of my subform but then the Rollback doesn't work.

Am I missing something?
Aug 27 '09 #5
ADezii
8,834 Expert 8TB
@keirnus
Could be as simple as the underlying Recordset is not Updateable. Programmatically set a Form's Record Source equal to this Recordset, add a couple of Bound Fields to the Form, then see if you can Update these Fields. Create an ADO Recordset as opposed to a DAO Recordset, then check the Supports Method of the Recordset with the adUpdate Argument to see if it is Updateable.
Aug 28 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Larry | last post by:
In VB 6, using ADO, SQL Server 2000 In my VB program I use the connection object (abc) to begin a transaction. abc.BeginTrans I then, in my VB App, using ADO, execute multiple stored...
8
by: David Bray | last post by:
I have an Access database on an ISP's web-space which is accessed through ASP - all standard stuff. Can anyone tell me whether ASP's object.context methods for transactions will work with...
2
by: Georges Heinesch | last post by:
Hi: I have a tables in relationship to each other. When I open the main table (table 1), I see a "+" at the very left of every record. Clicking on the "+" expands the data of the linked table...
2
by: jannordgreen | last post by:
I am using Win XP and MS Access 2003. In MS Visual FoxPro the Tableupdate() function specifies which changes made to the table or cursor should be committed. Does a similar thing exist in MS...
2
by: campbell_canuck | last post by:
Hello and TIA, I am trying to write some VB code to move some data between 2 Access databases using a code module in Access. As part of it, I am trying to use transactions. However, by the...
3
by: tom c | last post by:
In Access SQL, is there a way to rollback a transaction?
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
4
by: MrDeej | last post by:
At least not the way i would think it should Dim rst As New ADODB.Recordset Dim ws As Workspace Set ws = DBEngine.Workspaces(0) With rst ws.BeginTrans .Open "SELECT * from ",...
6
NeoPa
by: NeoPa | last post by:
Progress Indicator in Access Introduction Access has a bad habit of getting tied up with its processing and not giving a clue as to whether it has crashed or not (The operating system and tools...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.