mdb locked

E

eggpap

Hello,

mine is a problem that implies both Access and Excel.
The following sub gets called when the user select the MultiplePrint
customized menu command in one Excel 2003 Workbook. The workbook is
installed on about ten PCs and performs correctly on all but one.

On that PC the program shows an error message when reaches the
red-marked statement that says the "RiepMensili.mdb" is opened
exclusively by another user, or is missing.

How can I discover who or what locks it?

The RiepMensili.mdb has some tables linked to other tables of another
mdb. I have tried to open the RiepMensili.mdb by Access but I have not
found it locked. It opens without problems.

The folder containing both the workbook and the mdb are phisically
installed on the PC "A", are accessible by another user on the PC "B"
("A" and "B" are in the same room) and by the Intranet Administrator.
The error rises also when the "B" PC is turned off and I don't think the
Administrator gets constantly locked the mdb.

Help, please.

Sub MultiplePrint()
Dim RiepDBPath As String, SQLstr As String, SQL2 As String
Dim Mese As Long, anno As Long, CID As String, tipostampa As
String
Dim DataFineMese As Date, DFM As String, DataInizioMese As Date,
MeseSuccessivo As Long, AnnoSuccessivo As Long
Dim oApp As Access.Application
On Error GoTo err_hnd
Call Update
'Path riepmensili.mdb
RiepDBPath = ThisWorkbook.Path & "\RiepMensili.mdb"
MultiReport.Show 1
If rptAnnulla Then Exit Sub
If rptTutti = False Then
SQLstr = "[CID]=" & rptCID & " AND [MeseAnno]='" & rptMese &
"/" & rptAnno & "'"
Else
SQLstr = "[MeseAnno]='" & rptMese & "/" & rptAnno & "'"
End If
MeseSuccessivo = rptMese + 1
AnnoSuccessivo = rptAnno
If MeseSuccessivo = 13 Then
AnnoSuccessivo = rptAnno + 1
MeseSuccessivo = 1
End If
' datafinemese and datainiziomese in mm/dd/yyyy format for the
query qxRepFestivi
DataFineMese = DateAdd("d", -1, "01/" & MeseSuccessivo & "/" &
AnnoSuccessivo)
DFM = Month(DataFineMese) & "/" & Day(DataFineMese) & "/" &
Year(DataFineMese)
DataInizioMese = rptMese & "/" & "01/" & rptAnno

'elimina la query preesistente
SQL2 = "SELECT tbFestivi.CID, tbRisorse.Profilo, tbRisorse.Cognome,
tbRisorse.Nome, tbFestivi.DataF, " _
& "tbFestivi.Giust, tbFestivi.DataLimite, tbFestivi.DataRecupero
INTO tbxRepFestivi " _
& "FROM tbRisorse INNER JOIN tbFestivi ON tbRisorse.CID =
tbFestivi.CID WHERE " _
& "(((tbFestivi.DataF) <= #" & DFM & "#) And
((tbFestivi.DataLimite) " _
& ">= #" & DataInizioMese & "#));"

'Open Access
Set oApp = CreateObject("Access.Application")
oApp.Visible = False
* oApp.OpenCurrentDatabase RiepDBPath, , PWORD*
oApp.DoCmd.SetWarnings False
oApp.DoCmd.RunSQL SQL2
oApp.DoCmd.OpenReport "rptP46Mensile", acViewPreview, , SQLstr
oApp.DoCmd.PrintOut
oApp.DoCmd.SetWarnings False
oApp.CloseCurrentDatabase
Set oApp = Nothing
Exit Sub
err_hnd:
MsgBox Err.Description & "/" & Err.Number & " Sub StampaMultipla"
Resume Next
End Sub
 
E

eggpap

I found on the web the error rises when JET 4.0 SP8 is not installed and
is related to the Sandbox modality. Someone has experienced this?

How to know if that PC has SP8 installed?

Thanks, Emiliano
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top