A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Is it possible to include Begin And End Transaction code in VBA ?



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old June 17th, 2004, 03:57 AM
Jean
external usenet poster
 
Posts: n/a
Default Is it possible to include Begin And End Transaction code in VBA ?

Hi,

I took over a project and recenly converted the database from ACCESS 97/SQL
7 to MS ACCESS XP/SQL Sever 2000. The database object is use is DAO. The
users have been run into a lot of locks problem after the update. We
installed the SQL Server Standard version with default setting. I did some
research that the best way to handle the lock to have control over the
transaction. The previous developer uses Workspace. But as I step throught
the code, I don't see the locks been release after the CommitTrans fired and
user still hangs...
======================================
Function HandleNullMemID() As Boolean
On Error GoTo HandleErr

Dim mWS As Workspace
Dim strSQL As String
Dim boolInTrans As Boolean

Set mWS = DBEngine.Workspaces(0)
Set mDB = CurrentDb()

mWS.BeginTrans
boolInTrans = True
'Append unmatched records to exceptions tbl
strSQL = "qryMemPayImpExceptions"
mDB.Execute strSQL

'Delete unmatched records from import tbl
strSQL = "qryMemPayImpExceptionsDelete"
mDB.Execute strSQL
mWS.CommitTrans

boolInTrans = False
HandleNullMemID = True

HandleExit:
If boolInTrans = True Then mWS.Rollback
Exit Function

HandleErr:
ErrMsgBox Err.Description, basName & ".HandleNullMemID", Err.Number
HandleNullMemID = False
Resume HandleExit

End Function
===========================================
Please advise

Thanks

Jean


 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 02:35 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.