Results 1 to 2 of 2

Thread: can an open database be temp closed for backup then reopened?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 1999
    Location
    Brisbane, Qld, Australia
    Posts
    78

    Smile

    Hello,

    I open the database at the start of a program. I want to know whether i can temp close the database for backing up procedures to take place and then reopen it whilst the program is still operating. I have this to open the database:

    Function OpenDataBase(ByVal pDatabasName As String) As Boolean

    On Error GoTo OpenDataBaseError

    Set pWorkspace = Workspaces(0)
    Set pDatabase = pWorkspace.OpenDataBase(App.Path & "\" & pDatabasName, False, False, ";PWD=c00rpar00")

    OpenDataBase = True

    Exit Function

    OpenDataBaseError:

    Select Case Err
    Case Else
    MsgBox "Error#" & Err.Number & " " & Err.Description, vbInformation, App.Title
    End Select

    OpenDataBase = False

    End Function

    Is it as simple as I think.... changing OpenDatabase = true to false <= i assume that this will close it and just reopen it the same way? I just need clarification that this would work. Thanks for any help.

    Mike

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844
    I'm assuming pDatabase is a global variable, so you'd just have to use pDatabase.Close (or whatever the DAO equivalent is)

    you can then manipulate your DB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width