PDA

Click to See Complete Forum and Search --> : can an open database be temp closed for backup then reopened?


Spawny
Jun 21st, 2000, 07:03 PM
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

Clunietp
Jun 21st, 2000, 11:39 PM
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