[AccessD] Closing an open file

John Skolits askolits at ot.com
Tue Nov 7 10:52:27 CST 2006


Drew,

I'm looking at sysinternals.com like Fred Hooper suggested. Still trying to
figure out how to use it, especially through VBA. 

If it doesn't work out, I'll go down your suggested road.

John

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of DWUTKA at marlow.com
Sent: Tuesday, November 07, 2006 10:37 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Closing an open file

The only two ways to do this would be to have a program running on all of
your client machines, which would close the files at a certain time (or
close the files from some type of other prompting (ie, network comms,
inactivity, etc.).  Or, you will have to have admin rights on a server to
force a file closed.  How to do it programmatically, not entirely sure, but
I would start looking into the Window Server OS resource kits, I'd be
surprised if it was something other then a simple shell command (with the
right resource kit util)

Drew

-----Original Message-----
From: rusty.hammond at cpiqpc.com [mailto:rusty.hammond at cpiqpc.com] 
Sent: Monday, November 06, 2006 1:21 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Closing an open file

Yes, at least for an excel file anyway. I'm assuming ms word works the same
way.   When the file is read only, a copy gets loaded into excel without the
file being held open.  It also helps avoid the issue of someone making
changes to the report accidentally.  If they want to save changes, they can
to another filename but the master remains intact.

I agree the ability to close an open file would be nice, but for this
situation the read-only setting works great.



-----Original Message-----
From: John Skolits [mailto:askolits at ot.com]
Sent: Monday, November 06, 2006 1:01 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Closing an open file


Hmmm. No, they really don't need to make any changes. That may work. 
So you're saying, if the file is opened as read only, I Can delete it even
if someone has it open?

It would still be nice though to figure out a way to close it if it's open
anyway.
I think that would make things a bit cleaner.




-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
rusty.hammond at cpiqpc.com
Sent: Monday, November 06, 2006 1:07 PM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Closing an open file

John,

Do they need to make changes to the report?  If not I've solved this issue
by 
by setting the report to read only on the network.

Something like the following:

Function ExportRpt(strRptName as String, strFileAndPath as string)

     If Dir(strFileAndPath) <> "" Then
        SetAttr strFileAndPath, vbNormal
        Kill strFileAndPath
     End If

     DoCmd.OutputTo acOutputReport, strRptName, acFormatXLS, strFileAndPath
     SetAttr strFileAndPath, vbReadOnly
End


HTH,

Rusty


-----Original Message-----
From: John Skolits [mailto:askolits at ot.com]
Sent: Monday, November 06, 2006 11:33 AM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] Closing an open file


When running Access, I create reports every night, but inevitably, some user
has opened the file off the network and never closed it. I can't remove it
with KILL.
Any one have code for closing a file that may be open so I can then delete
it?

John


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

**********************************************************************
WARNING: All e-mail sent to and from this address will be received,
scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc.
corporate e-mail system and is subject to archival, monitoring or review 
by, and/or disclosure to, someone other than the recipient.
**********************************************************************
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

**********************************************************************
WARNING: All e-mail sent to and from this address will be received,
scanned or otherwise recorded by the CPI Qualified Plan Consultants, Inc.
corporate e-mail system and is subject to archival, monitoring or review 
by, and/or disclosure to, someone other than the recipient.
**********************************************************************
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list