Scripts

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have seen posts that suggest writing scripts for things like temporary
changes of security levels for the current instance of Access (to prevent
warning messages) or for changing the registry keys to prevent the progress
bar from displaying when loading pictures. Are you simply referring to VBA
code in a startup macro or is it more specific like VBScript?
 
Elaine K said:
I have seen posts that suggest writing scripts for things like temporary
changes of security levels for the current instance of Access (to prevent
warning messages) or for changing the registry keys to prevent the progress
bar from displaying when loading pictures. Are you simply referring to VBA
code in a startup macro or is it more specific like VBScript?

The latter. Putting it in VBA code in a startup macro is too late: the
security level will already have kicked in by the time that code runs.

Take a look at what Jeff Conrad has at
http://home.bendbroadband.com/conradsystems/accessjunkie/macrosecurity.html
 
Thank you Doug. My understanding was that VBScript was for web applications
only. I have no experience there - mine is a single user, single machine
application. So where would I look for VBScript programming basics such as
syntax and how to execute the code? I have searched the Knowlege Base but
could not find this type of information there.
 
VBScript can be run using either cscript.exe or wscript.exe.

Odds are your machine already has an association to one or the other for the
..vbs file extension.

Try copying that script

dim o
set o=createobject ("Access.Application")
o.automationsecurity=1 ' set macro security LOW.
o.opencurrentdatabase "full path to your database"
o.visible=true
o.usercontrol=true
set o=nothing

into a file and naming it Test.vbs. (don't forget to replace full path to
your database with the appropriate path)

Now, try double-clicking on that file. Does it work?

If not, try creating a shortcut along the lines of:

cscript //nologo "full path to the test.vbs file you just created"

and see whether that works.

To learn more about VBScript, start at
http://msdn.microsoft.com/library/e...d7-7d8f-4368-b2a7-065acb52fc54.asp?frame=true

Don't be concerned that that site is under the Web Development segment of
MSDN: it's just a place to put it.
 
Just two more quick questions before I go off on my VBScript 101 course.
Could users encounter a problem if I use VBScript and subsequently distribute
my system with Runtime Access? Can I change the registry keys to prevent the
loading status bar from showing when loading pictures upon entry of my
application but then return the keys to their original state when my
application closes.
 
I don't believe there should be any problems with the runtime version: it's
the same executable, after all.

And as long as you keep the original key values somewhere, there's no reason
you can't reset them when exiting the application.
 
Back
Top