Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: exclusive access to the database


Message #1 by "peter pennells" <ppenn@b...> on Thu, 22 Aug 2002 09:47:41
Hello, Everyone

I am developing an Access(2002) VBA application, on the forms I used 
command buttons to run querys and using query data to mail merge with Word
(2002), it works as what I wanted. 

Every time when I run the programme once, then Access locks me to edit, it 
comes up with a message saying: you do not have exclusive access to the 
database this time. If you proceed to make changes, you may not be able to 
save them later.

When I closed Access, the .ldb file still locked, I cannot delete it, it 
says: there has been a sharing violation. The source or destination file 
may be in use.

I have been to Microsoft website, searched for help, suggested multi-user, 
and checked all the permission, updated windows, service pack, and even 
rebuilt the machine, it still does it, very frustrated, hope any one can 
help.

Many thanks in advance

Peter
Message #2 by "George Oro" <george@c...> on Thu, 22 Aug 2002 13:44:04 +0400
What you mean by program, Access or Word?
What's your db setup, Stand Alone or Network?

PA
George




-----Original Message-----
From: peter pennells [mailto:ppenn@b...]
Sent: Thursday, August 22, 2002 9:48 AM
To: Access
Subject: [access] exclusive access to the database


Hello, Everyone

I am developing an Access(2002) VBA application, on the forms I used 
command buttons to run querys and using query data to mail merge with Word
(2002), it works as what I wanted. 

Every time when I run the programme once, then Access locks me to edit, it 
comes up with a message saying: you do not have exclusive access to the 
database this time. If you proceed to make changes, you may not be able to 
save them later.

When I closed Access, the .ldb file still locked, I cannot delete it, it 
says: there has been a sharing violation. The source or destination file 
may be in use.

I have been to Microsoft website, searched for help, suggested multi-user, 
and checked all the permission, updated windows, service pack, and even 
rebuilt the machine, it still does it, very frustrated, hope any one can 
help.

Many thanks in advance

Peter

Message #3 by "peter pennells" <ppenn@b...> on Thu, 22 Aug 2002 11:49:10
Hi, George
I use Access VBA programming to mail merge the data into word, all use VBA.
It is on the Network.
Since I posted the message eariler today, I have found out that when it 
mail merge to word, it generat three document, sit at background (not 
visible), what code do I need to set Document visible, my coding is below:
Many thanks
Peter


Function MergeIt()
Dim oMainDoc As Word.Document
Dim sDBpath As String

Set oMainDoc = GetObject("\\Serverc\Applications\planning\Access 
Reports\myMerge.doc", "Word.Document")

With oMainDoc.MailMerge
    .MainDocumentType = wdFormLetters
    sDBpath = "\\Serverc\Applications\planning\Access Reports\customer.mdb"
    .OpenDataSource Name:=sDBpath, SQLStatement:="Select customer.* from 
customer"
   
End With


With oMainDoc
    .MailMerge.Destination = wdSendToNewDocument
    .MailMerge.Execute Pause:=False
End With

End Function


> What you mean by program, Access or Word?
What's your db setup, Stand Alone or Network?

PA
George
Message #4 by "Andy Whittaker" <andy.whittaker@g...> on Thu, 22 Aug 2002 13:45:43
I think that the two lines of code I added are what you are looking for.

With oMainDoc
     .MailMerge.Destination = wdSendToNewDocument
     .MailMerge.Execute Pause:=False
     .Visible = True
     .Activate
End With

what code do I need to set Document visible, my coding is below:
M> any thanks
P> eter


Message #5 by "Scott Eisenreich" <seisenreich@h...> on Thu, 22 Aug 2002 08:46:31 -0400
I have run into the exact same problem. The only way I was able to save my 
changes was to make a copy of the database, delete the original & the .ldb 
file & rename the copy. I also put all of my databases on a server that the 
IT group backs up nightly (you never know!).


>From: "peter pennells" <ppenn@b...>
>Reply-To: "Access" <access@p...>
>To: "Access" <access@p...>
>Subject: [access] exclusive access to the database
>Date: Thu, 22 Aug 2002 09:47:41
>
>Hello, Everyone
>
>I am developing an Access(2002) VBA application, on the forms I used
>command buttons to run querys and using query data to mail merge with Word
>(2002), it works as what I wanted.
>
>Every time when I run the programme once, then Access locks me to edit, it
>comes up with a message saying: you do not have exclusive access to the
>database this time. If you proceed to make changes, you may not be able to
>save them later.
>
>When I closed Access, the .ldb file still locked, I cannot delete it, it
>says: there has been a sharing violation. The source or destination file
>may be in use.
>
>I have been to Microsoft website, searched for help, suggested multi-user,
>and checked all the permission, updated windows, service pack, and even
>rebuilt the machine, it still does it, very frustrated, hope any one can
>help.
>
>Many thanks in advance
>
>Peter




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


  Return to Index