Access options in MS Access 2007 - ms-access

How can I disable the access-options or to hide it?
Update
If you open your MS Access 2007, you usually see the button at the upper left the "Microsoft Office button" and if you click on that, you'll see the different functions like: "new", "save", "open" etc and at the button you'll see the "access options" and "exit".

Make a ACCDE copy of the DB
This will Strip out your VB source (but will leave the compiled code intact).
but first get your menu setting the way you want
e.g.
1. click Access Options->Current Database.
2. Uncheck "Enable Full Menus" for this database
3. From the Database Tools menu, choose "Make ACCDE"
Note Unless you apply a valid digital signature to you DB, Access will warn about VB script and prompt user to Open or cancel good thing is it will quit if they don't accept run VB script but its better to create a digital signature for your DB
Hope this helps

Presumably this is only for the users. You can create a shortcut which the users use on their desktops which has the /runtime command line option. The problem though is you then have to add the path and file name of the msaccess.exe file, ie "C:\Program Files....\msaccess.exe"
Using the free Auto FE Updater makes this entire process a lot easier as well as automatically updating the FE as you make updates available to the users.

Related

Create a standalone form shortcut in Microsoft Access 2013

I currently have a functioning form that searches through my database by calling a query. What I'm trying to do is turn this into a standalone application where I can simply open a file and only the form opens, running the database on the back-end. I have tried running a macro that opens the form, and I have tried creating a shortcut to my desktop, but nothing has worked.
Does anyone have any suggestions? Anything that will only show the form and the search results would be good (desktop shortcut, HTML file, etc.).
Thanks!
You will need to split your database so that the tables are located in a separate back-end file (which can be kept on a server). These instructions apply to Access 2007 and 2010 but the process is very similar for 2013.
Once this is done, your tables will become linked tables (stored in a separate file) and your front-end .addcb file will only contain queries, forms and reports.
You can control which form opens when the application loads through File -> Options -> Current Database. There are also several other useful controls here for limiting what the user can do; ie.
Hiding the list of database
Hiding the tabs (you will therefore need to create buttons to move between forms)
Hiding the Ribbon and/or status bar
Disabling Layout View
It's safest to change these settings on a copy, so you don't inadvertently lock yourself out; however, by holding down shift when opening the file from within Access, most of these options will be bypassed and you will be able to edit the database / revert these settings should you need to.
In terms of making it a "stand-alone application", it is possible to create a copy that will open without requiring the full version of MS Access on the user's PC (instead using Access Runtime).
I always distribute my front-ends as .accde format (File -> Export ACCDE). The benefits are as follows:
Smaller file size
Optimise memory usage / improves performance
VBA code runs but cannot be viewed or edited
I think what you're looking for is here:
http://office.microsoft.com/en-us/access-help/command-line-switches-for-access-HA010166605.aspx
and
http://office.microsoft.com/en-us/access-help/command-function-HA001228801.aspx
Basic idea, create a macro called AutoExec that checks for a command line argument when opening the database. Setup a shortcut with a command line argument (whatever you decide to name it, I'll use 'lookuponly' as the example.) like this:
"C:\Users\%Username%\Desktop\MyDatabase.mdb" /cmd "lookuponly"
when you double click the shortcut it should auto-run the macro and open your lookup form. Of course under newer versions of access you'll have to set the location of the database as a trusted location or access will attempt to block the database.
http://office.microsoft.com/en-us/access-help/decide-whether-to-trust-a-database-HA010256412.aspx

Hide MS ACCESS DB FILE

I am currently using an access DB with front and back end. When I want to allow new users to access the DB I add the user to the folder in which the DB is housed. Essentially if they determined the path of the DB they could copy it ect.
Is there anyway to still allow access to the DB through the Access front end yet still prevent the user from actually getting to the directory of the file.
Thanks in advance for all your help.
No there isn't access is a file based dbms. For the app the user is running as to see the file, the user has to be able to.
This is the sort of need that says access cannot be used. Well not directly , you could use access as a backend, ie you park it behind some sort of service and your front end hits that.
yo keep an integral copy for you in case of changes then with the pblic copy, for example
with Access 2007 you click files -> Options -> active data base -> Navigation Options.
then you hide all the elements...

Opening an Access Form from a hyperlink

We currently have an ASP/SQl Server system, which has an option to send an e-mail to a user. This e-mail contains a hyperlink to another ASP page, which shows a specific database record.
I'm currently working on a resilience version of the system, which is MS Access based. The user's would like to keep the same functionality, and have an e-mail which contains a hyperlink back to the database, opening a specific form and filtering it to a record.
I believe the solution lies somewhere in using Command() to get the parameters from the command line, however I am actually having difficulty currently opening the database itself. The code i'm currently using is:
<a href="C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.exe
H:\Access DB\11th March\Link to DB\Dealer
Startup Admin EU v10.mdb" >
TEST
</a>
I think this should open the Dealer Startup database, however it is failing stating the file cannot be found. If I remove the second step i.e. H:\Access DB etc. the link opens Access, so I am wondering if i'm doing something syntactically incorrect? The file path definitely seems right.
Also would someone be able to give some advice on the use of /c in a hyperlink? The small amount of information I have found seems to suggest it doesn't work but if someone could clarify or give me an example of how to do it I would appreciate it
Thanks,
Chris
I managed to create a solution to this problem. I could not find a direct way to open the Access DB from a hyperlink, however you can hyperlink to a shortcut. The workaround I therefore used was to create a shortcut to the database using the following syntax:
"file path to ms access" "file path to database" /cmd Args
so for example:
"C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.exe" "C:\Documents and Settings\Database.mdb" /cmd Args
Creating a shortcut to this file path opens the database. I then created an autoexec macro which opened a specified form if the Command() function returned Args. This meant that when opening the database normally you would be taken to the usual form, but when opening from the shortcut you will be taken to a different form.
I then created the e-mail hyperlink to the shortcut.
I have created a batch file to delete browser history for MSIE and kept it on the server-side. When the user clicks on 'delete browser history' hyperlink, I just make him download this file, and the user runs it manually.
You can also do something similar.

MS Access - Open database form from URL

I'm trying to open a form from an url. This ms access database will be hosted on a shared folder in an network, and the costumer has asked me if it's possible to open an database form (i'll have to pass an ID).
If this were in web environment i would do this without any problem, but honestly in ms access i have no idea how to do this.
Can someone help me?
Have a look at Register protocol and Registering an Application to a URL Protocol. They have a example registry file on how to register a protocol:
REGEDIT4
[HKEY_CLASSES_ROOT\foo]
#="URL:foo Protocol"
"URL Protocol"=""
[HKEY_CLASSES_ROOT\foo\shell]
[HKEY_CLASSES_ROOT\foo\shell\open]
[HKEY_CLASSES_ROOT\foo\shell\open\command]
#="\"C:\\Program Files\\Application\\program.exe\" \"%1\""
You can change the last line to something like:
#="\"C:\\Program Files\\Office\\access.exe\" \"C:\\path\\to\\your\\db.mdb\" /cmd \"%1\""
If you URL is foo:241245, the following command is called:
"C:\Program Files\Office\access.exe" "C:\path\to\your\db.mdb" /cmd "241245"
In Access, the commandline arguments are returned by the Command function:
In the direct window:
?Command
241245
The database can be opened from a URL like any other file:
file://server/share/path/database.mdb
This won't work if the database has user-level security on it though. I've only ever done that by using a windows shortcut.
If you're not using user-level security and the URL works, you can set the desired form to open automatically on load by going to the Access Options screen and the Current Database tab, then selecting the desired form from the Display Form drop-down list.
Oops - I just noticed that you said you'd need to pass an ID. I don't know if that's possible using a URL.
Open your Access database from the network location (i.e., with a UNC path, not from a drive letter, or locally).
Navigate so you can see the form listed in your database.
Drag the form to your desktop. A shortcut directly to the form will be created there.
I don't think this is a good idea, though. It's a substitute for a user interface in your Access application. Additionally, your description of the problem sounds like you're intending to have multiple people opening the same database file. This is a really bad practice -- best practice is for the database to be split (back end with data tables only on the server, and individual copy of the front end with forms/reports/etc. on each user's workstation), and more than one user should never be opening the same front end at the same time.

Getting at VBA/Access Source Code

I'm rewriting a legacy access / VBA application in C#. While I am limited as a VBA programmer I am under the impression that the code is minimally compiled and runs almost as a script ? Obviously no security / VBA you can just hit alt + f11 to get at the source code is there a good way to decompile / get at this code?
So I tried this: http://forums.databasejournal.com/showthread.php?t=34222
which appears to be about how to decompile .mdb files.
However the program quickly recompiled itself - or at least says it is recompiling itself in the lower left status bar. Any ideas?
Here are some suggestions (some of which I'm repeating from comments I've made above):
Alt-F11 is not my usual method of opening the VBE, because I usually want to go to the Immediate Windows. Try Ctrl-G, instead.
If both Alt-F11 and Ctrl-G fail to open the VBE, then perhaps the AllowBypassKey property of the database has been changed to False. To get code to change this, search the Access help file for AllowBypassKey (in the VBE, from the help menu, search for "AllowBypassKey"). However, you won't be able to run the code within the database you're trying to investigate if AllowBypassKey is turned OFF, so you can run this code:
//
On Error GoTo Change_Err
Dim db As DAO.Database
Dim prp As Variant
Const conPropNotFoundError = 3270
Set db = DBEngine.OpenDatabase("C:\Databases\MyDatabase.mdb")
db.Properties("AllowBypassProperty") = True
exitRoutine:
If Not (db Is Nothing) Then
db.Close
Set db = Nothing
End If
Exit Sub
errHandler:
If Err = conPropNotFoundError Then ' Property not found.
' do nothing and exit
Resume exitRoutine
End If
Then you should be able to open the database when holding down the SHIFT key (which bypasses any defined startup routines, which might have been shutting off access to the VBE).
If the file is an MDE, there is no source code. You can find out if it's an MDE by checking this property:
?CurrentDB.Properties("MDE")
If it's an MDE (the file can have any extension), this will return "T". If it's not an MDE, it will throw an error (because the property doesn't exist).
Other things to check might be how many modules there are. If you have the database open and can get to the Immediate Windows (Ctrl-G), then this will tell you if there are any modules:
//
?CurrentProject.AllModules.Count
You also might be able to see what's in the database by opening up the Object Browser in the VBE (F2) and selecting the project name in the dropdown at the top (it will say "" by default
Last of all, you may think that it could be protected by Jet ULS, but starting with Access 2000, that's not a big possible, as there's nothing but a password on the VBA project available (i.e., it's no longer covered under Jet ULS). I would expect that if it were password-protected, you'd be prompted for the password somewhere along the line, so you'd already know that.
If it's an .mde you are out of luck. You need to get hold of the .mdb containing the source VBA code that was compiled to create the .mde
HOW TO VIEW SOURCE CODE (.mdb FILE)
Select the file
Hold the 'shift' key
Then double click the file without releasing the 'shift' key
Navigate to the Program Folders on your computer.
Open the MS Office Folder
Navigate to MSAccess.exe and make a shortcut of it.
Move the shortcut to where your database resides (makes life easier and you'll need to do this for each database to decompile).
(optional) Rename the shortcut to something like "decompiler for my database whose name is...." so you know that opening it blows away your compiled code
Right-click on the shortcut to view its properties. In the Target field of the properties dialog box for the shortcut you'll see something like "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE"
In the target field, right-arrow to the end of the pathname, type a space, and then, in quotes, type (or paste) the full pathname of the location of your MS Access file to decompile (easiest way is to copy from the address bar on your window where the file resides, if you have the address bar showing).
Still in the Target field, type a space, and then with no quotes, type /decompile
Click OK to accept the changes and to close the dialog box.
Hold the Shift key down and keep it down.
Wiggle your ears
Double-click on the shortcut.
Go to any module in your database.