PC Review


Reply
Thread Tools Rate Thread

DAO Workspace in Access 2007

 
 
AG
Guest
Posts: n/a
 
      18th Jul 2008
According to KB article http://support.microsoft.com/kb/928025/en-us
A DAO Workspace can not be created in Access 2007.
How can a DAO operaton be wrapped in a transaction so that it can be rolled
back in case of failure, since transaction operations are Workspace methods?

Thanks,

--

AG
Email: discussATadhdataDOTcom


 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      18th Jul 2008
"AG" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> According to KB article http://support.microsoft.com/kb/928025/en-us
> A DAO Workspace can not be created in Access 2007.
> How can a DAO operaton be wrapped in a transaction so that it can be
> rolled back in case of failure, since transaction operations are Workspace
> methods?



You can't *create* a workspace object, apparently, but you can use the
existing one that Access is using. For example:

Dim ws As DAO.Workspace

Set ws = DBEngine.Workspaces(0)

ws.BeginTrans

ws(0).Execute _
"INSERT INTO Table1 (TextField) VALUES('Transaction')", _
dbFailOnError

If MsgBox("Commit this update?", vbYesNo, "Commit?") _
= vbYes _
Then
ws.CommitTrans
Else
ws.Rollback
End if

Set ws = Nothing

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 
Reply With Quote
 
AG
Guest
Posts: n/a
 
      19th Jul 2008
Thanks Dirk. That's how I normally do it, but that article had me worried
for a bit.

--

AG
Email: discussATadhdataDOTcom
"Dirk Goldgar" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> "AG" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> According to KB article http://support.microsoft.com/kb/928025/en-us
>> A DAO Workspace can not be created in Access 2007.
>> How can a DAO operaton be wrapped in a transaction so that it can be
>> rolled back in case of failure, since transaction operations are
>> Workspace methods?

>
>
> You can't *create* a workspace object, apparently, but you can use the
> existing one that Access is using. For example:
>
> Dim ws As DAO.Workspace
>
> Set ws = DBEngine.Workspaces(0)
>
> ws.BeginTrans
>
> ws(0).Execute _
> "INSERT INTO Table1 (TextField) VALUES('Transaction')", _
> dbFailOnError
>
> If MsgBox("Commit this update?", vbYesNo, "Commit?") _
> = vbYes _
> Then
> ws.CommitTrans
> Else
> ws.Rollback
> End if
>
> Set ws = Nothing
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Office 2007 meeting workspace feature PhilPense Microsoft Outlook Discussion 0 28th Dec 2009 02:22 PM
Word 2007 document workspace creation ron37 Microsoft Word Document Management 0 4th May 2009 06:56 PM
PPT 2007 Collaborative WorkSpace =?Utf-8?B?dG1mMTIz?= Microsoft Powerpoint 0 19th Nov 2007 03:30 PM
Where is the ruler in the workspace of emailmessages in OO 2007? =?Utf-8?B?Sm9lcGll?= Microsoft Outlook Discussion 1 8th Nov 2007 05:49 AM
Workspace & Links referenced when workspace opened. =?Utf-8?B?TFRCIEAgTWlhbWksIE9L?= Microsoft Excel Worksheet Functions 2 7th Mar 2006 10:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:43 PM.