Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Closing Access Database on server

Status
Not open for further replies.

mo2783

Programmer
Nov 16, 2003
68
GB
Hello People

I am new to scripting, but i have a task to write a script to close a Access database or make sure its closed on a server before the backups run. I have no idea how to do this, what editor i would need to use etc.

Any help would be much appreciated.

Thanks

Mo


 
How about:

Code:
strLDB = "C:\Docs\TT.ldb"
strMDB = "C:\Docs\TT.mdb"

Set FSO=CreateObject("Scripting.FileSystemObject")

If Not FSO.FileExists(strLDB) then
   msgbox "Not open"
   wscript.Quit
End If

set acApp=getobject(strMDB)

acApp.quit
 
Thanks Remou for the help will try this out but before i do should i copy this in to a text file and rename the file as <filename>.vbs?

And then i can make the file a shedule task to ran say 5 mins before the backup rans.

Sorry to be a pain, like i said this is my first time doing this.

Thanks again

Mo
 
Remou,

This will happen late at night the nuser leave the database running, so we need to close it before we back up. Otherwise the database will not be backed up.

So do i need to copy the code to a text file and rename it with the extension .vbs?

Cheers

Mo

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top