[AccessD] Knowing when DB is read-only

Erwin Craps - IT Helps Erwin.Craps at ithelps.be
Wed Feb 16 05:29:39 CST 2005


Thank you

Would I be able to get a correct filestatus from within the databasefile
itself?

Erwin

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of A.D.Tejpal
Sent: Tuesday, February 15, 2005 7:39 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Knowing when DB is read-only

Erwin,

    You should be able to get the status via file system object.
Suitable user defined function is given below. Reference to Microsoft
Scripting RunTime is needed.

    Following expression will get the status for the current db.
        Fn_GetDbStatus(CurrentProject.FullName)

With best wishes,
A.D.Tejpal
--------------

================================
Function Fn_GetDbStatus(ByVal Fpt _
                                    As String) As String
    Dim fso As FileSystemObject, fe As File
    Dim Dbs As Long, Sts As String
    
    Sts = "Other"      ' Default Value
    
    Set fso = New FileSystemObject
    Set fe = fso.GetFile(Fpt)
    Dbs = fe.Attributes
    Select Case Dbs
        Case 1
            Sts = "ReadOnly"
        Case 2
            Sts = "Hidden"
        Case 32
            Sts = "Archive"
    End Select
    
    Fn_GetDbStatus = Sts

    Set fso = Nothing
    Set fe = Nothing
End Function
================================

  ----- Original Message -----
  From: Erwin Craps - IT Helps
  To: Access Developers discussion and problem solving
  Sent: Tuesday, February 15, 2005 15:59
  Subject: [AccessD] Knowing when DB is read-only


  Dear group
   
  I have a backend MDB database that is about 677MB in size and
  growing....
  For reasons of fast recovery this file is not only backuped on tape
  several times a day, but also copied several times a day to my
notebook
  computer (using briefcase but I don't use syncing at datalevel, just
  file level).
   
  Because copying this file takes about a minute or so, it seems that
the
  database get's in a read-only state.
  I noticed this because on my server two applications run every 2,5
  minutes dooing some stuff on it, but during the filecopy I get "No
  updateable query" errrors.
   
  So the question is, how can I get the state of the database during
  opening so I can leave straightaway the application on the server when
  it notices that the backend is read-only or whatever state while
copying
  the file to my notebook???
   
  Greetz 

  Erwin Craps
  Zaakvoerder 

--
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