I
Irina
I have a database with Autoexec Macro in it (which would run when a user
opens the DB) I dont want to open that particular DB manually. So I have a
script that would open the DB and the macro will run (macro just creates a
copy of a certain table with a date appended to the name of the table for
backup purposes). I can not get the script to work. It is a VBScript, and it
says that it is running, however the macro is not being run because there is
no resulting table from the macro.
Here is the code in case you can help with this
Dim objConnection
Dim objRecordSet
Set wshshell = WScript.CreateObject("WScript.Shell")
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source
=F:\Litigation\Immigration\Immigration Database\Immigration Reports_BE.mdb;"
MsgBox("Connected to Immigration DB")
WScript.sleep(3000)
MsgBox("close connection")
objConnection.Close
WScript.Quit
opens the DB) I dont want to open that particular DB manually. So I have a
script that would open the DB and the macro will run (macro just creates a
copy of a certain table with a date appended to the name of the table for
backup purposes). I can not get the script to work. It is a VBScript, and it
says that it is running, however the macro is not being run because there is
no resulting table from the macro.
Here is the code in case you can help with this
Dim objConnection
Dim objRecordSet
Set wshshell = WScript.CreateObject("WScript.Shell")
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
objConnection.Open "Provider = Microsoft.Jet.OLEDB.4.0; Data Source
=F:\Litigation\Immigration\Immigration Database\Immigration Reports_BE.mdb;"
MsgBox("Connected to Immigration DB")
WScript.sleep(3000)
MsgBox("close connection")
objConnection.Close
WScript.Quit