Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 17th, 2008, 05:48 AM
Friend of Wrox
 
Join Date: Apr 2007
Location: , , .
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default Access application exit button generate lock

Hi

I've spend lot of time but I can't find an answer how to reslove this lock issue

When click on exit button creates Lock on SQL
Here's code

* NOTE This code is on Form X after updating values on FormX , Customer Form
Updates Values

Sub Exit_Click()
On Error Resume Next
Dim passed As Boolean
RunCommand acCmdSaveRecord -- Error (it take long time to save)
Me!TotalValue = order_val(Me!MID, Me!Date, passed)
DoCmd.Close acForm, Me.Name -- Error (again it take long time here)
DoCmd.Close
End Sub

On close event

Private Sub Form_Unload(Cancel As Integer)
update_localorder Me!MID
Forms!Customers.SubReport.Requery-- Error (It takes time here as well)
End Sub


On SQL server activity monitor it shows
Command --> Update
Wait type --> LCK_M_X
RID --> 6:1:76550:9

and after 1 or 2 minutes lock reslove itself...

This issue is not 100% consistant, sometimes there's no issue in closing forms

Any suggestion

Regards

Ayaz

Reply With Quote
  #2 (permalink)  
Old June 17th, 2008, 10:28 AM
Friend of Wrox
 
Join Date: Apr 2007
Location: , , .
Posts: 110
Thanks: 1
Thanked 2 Times in 2 Posts
Send a message via MSN to ayazhoda
Default

Solution!

Check Table have dependencies or not
Check what dependencies are i.e view , table
If view then change select statement with No lock

select * from .... WITH (nolock)

Make sure view which linked with access are not updateable from Access application otherwise create duplicate records if opened or changed by any other user session.

Thanks

Reply With Quote
Reply


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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Force users to exit access application giswim Access 10 January 31st, 2014 03:27 AM
Application.exit() fails to terminate application. saumya General .NET 1 January 4th, 2008 08:50 AM
Exit Application King_ General .NET 0 February 23rd, 2006 09:30 AM
Use of Active lock 1.6 and Generate Key eresina Pro VB 6 5 April 5th, 2004 06:43 AM
Application.Exit() Help rodmcleay C# 2 October 8th, 2003 07:54 PM



All times are GMT -4. The time now is 04:08 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.