S
silva
Due to irritation with that stupid security warning when starting up a
database, I employed the following script to start one:
-------------------------------
Const cDatabaseToOpen = "<filepath>"
Const msoAutomationSecurityLow = 1
On Error Resume Next
Dim AcApp
Set AcApp = CreateObject("Access.Application")
If AcApp.Version = 11 Then
AcApp.AutomationSecurity = msoAutomationSecurityLow
End If
AcApp.OpenCurrentDatabase cDatabaseToOpen
If Err = 0 Then
AcApp.Visible = True
AcApp.UserControl = True
Else
AcApp.Quit
MsgBox "Failed to open '" & cDatabaseToOpen & "'." & vbCrLf &
Err.Description
End If
-------------------------------
And due to the fact that it opened the DB in a smaller window, I created an
AutoExec macro to maximize the Access window on DB startup. However, the
macro only successfully maximizes the window when I open the DB without the
script. It'll run just about anything in the macro except for the maximize
command when I use the script. The following command was suggested for the
startup script, "Application.RunCommand acCmdAppMaximize", but I don't know
how to implement it as the code. It won't run in the .vbs script (throws up
an error), and I don't know any other way to do it other than using the macro
titled AutoExec.
Is there any way to get this to work properly? I'd like to get this to work
without need of certificates (not going to pay for one, and I don't have
administrative priviledges on this P.O.S. pc to install StartCert or whatever
it's called) or setting the individual pc's to low security as any DB I use
would be saved on a network drive that'll have the same path on every pc on
the network.
database, I employed the following script to start one:
-------------------------------
Const cDatabaseToOpen = "<filepath>"
Const msoAutomationSecurityLow = 1
On Error Resume Next
Dim AcApp
Set AcApp = CreateObject("Access.Application")
If AcApp.Version = 11 Then
AcApp.AutomationSecurity = msoAutomationSecurityLow
End If
AcApp.OpenCurrentDatabase cDatabaseToOpen
If Err = 0 Then
AcApp.Visible = True
AcApp.UserControl = True
Else
AcApp.Quit
MsgBox "Failed to open '" & cDatabaseToOpen & "'." & vbCrLf &
Err.Description
End If
-------------------------------
And due to the fact that it opened the DB in a smaller window, I created an
AutoExec macro to maximize the Access window on DB startup. However, the
macro only successfully maximizes the window when I open the DB without the
script. It'll run just about anything in the macro except for the maximize
command when I use the script. The following command was suggested for the
startup script, "Application.RunCommand acCmdAppMaximize", but I don't know
how to implement it as the code. It won't run in the .vbs script (throws up
an error), and I don't know any other way to do it other than using the macro
titled AutoExec.
Is there any way to get this to work properly? I'd like to get this to work
without need of certificates (not going to pay for one, and I don't have
administrative priviledges on this P.O.S. pc to install StartCert or whatever
it's called) or setting the individual pc's to low security as any DB I use
would be saved on a network drive that'll have the same path on every pc on
the network.