Launching MDB File From MS-DOS

C

Chuck

Not sure what newsgroup to put this in. We use FrontPage to develop our
intranet where I work. On certain pages, we use links to start Access
programs written for certain things... exams, certifications, etc. I can
double-click on the MDB file on the share drive that it is saved on and it
launches the program. When the same file is added to FrontPage, the
hyperlink to the file prompts the user to open/save the file, and not treat
it as an executable. When the user selects open, nothing happens.
Selecting save actually saves the whole access program on their local hard
drive. Okay, to get around this, we made MS-DOS batch files to call Access
and pass the mdb file to it as a command line. This works, however,
depending on what the last user set the Access window size to, windows
reopens the application in that "remembered" size. Adding docmd.maximize
doesn't work as this only affects the form, not the windows application.
Does anyone know another way around this? Is there a way to launch a "call"
within a batch file and have it maximize the application?
 
G

Graham R Seach

Chuck,

You need to use the path to msaccess.exe, followed by the path to the
database file. (This is all on one line")

"c:\Program Files\Microsoft Office\Office 10\MSACCESS.exe"
"c:\myDB\MyDatabase.mdb"

If you've secured the database with user/group level security, you need to
append the path to the mdw file. (This is all on one line")

"c:\Program Files\Microsoft Office\Office 10\MSACCESS.exe"
"c:\myDB\MyDatabase.mdb" /wrkgrp "c:\myWorkgroup.mdw"

See the online help for "startup command-line options"

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
C

Chuck

Graham,

Thats what we had orginally coded in FrontPage and it didn't work. It would
prompt the user for the open/save request, and if you selected open, nothing
happened. Selecting save would save the database on their drive. It was
the idea of the batch file from somewhere in the newsgroups. It still
prompts the user, but when selecting open, it starts up access and opens the
mdb file. The issue still remains about maximizing the window. Sure, I can
walk around to all the computers and alter the properties and indicate to
open the window to maximize, but thats just not going to happen. I think
our intranet is secured to a point where the prompt is always going to
happen to prevent accidental downloads.
 
G

Graham R Seach

Chuck,

You're talking about firing up the database from a DOS batch file - the
command-line script I gave you *will* work, and it *won't* prompt you for
the Open/Save dialog. You must include the quotes, and the space between the
paths.

"c:\Program Files\Microsoft Office\Office 10\MSACCESS.exe"
"c:\myDB\MyDatabase.mdb"

Of course, you have to know where msacess.exe is, ahead of time.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
C

Chuck

If you are saying to put those lines into a batch file, then its exactly
what we have.

We have:
@echo off
"C:\Program Files\Microsoft Office\Office\MSACCESS.exe "
"G:\Shared_data\AVCN\Apps\FLDT.mdb"
exit

Thats it. Thats what Frontpage points to as the hyperlink. I can
double-click the file and it launches ok. From the link in a browser, it
prompts the user. The "always prompt" check box is greyed out and checked,
so thats what makes me think that the intranet has that as a default.

I can't change the security end of it, so if thats the case, we get the
prompt. Bottom line is that I am okay with that, as long as I get the
original issue and thats to get the application to maximize. It remembers
what size window Access was last saved as.
 
P

PC Datasheet

Chuck,

If your .mdb opens to a specific form, put this code in the Open event of
the form:
DoCmd.Maximize
 
C

Chuck

Done that to, but that maximizes the form to whatever size the access window
is, it doesn't maximize the window, just the form.
 
G

Graham R Seach

Chuck,

Works fine for me. Make sure you have an actual space between the two paths,
not one that you've added to a path, AND make sure both paths are entered on
the same line.

echo off
"C:\Program Files\Microsoft Office\Office\MSACCESS.exe"
"G:\Shared_data\AVCN\Apps\FLDT.mdb"
exit

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
G

Graham R Seach

Chuck,

Thick 'ol me, I just realised what you were trying to say - that the web
page tries to download the file instead of executing it. In that case, I
have no answer for you, except to say that you should pose *that* question
to the FrontPage (or other related) newsgroup. They'll know more about
executing files via a web page.

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
---------------------------
 
C

Chuck

Thank you... that did it. Though the form doesn't center when it opens even
though the property is set to yes. Thanks again.
 
V

Van T. Dinh

It sound like the Form is opened before the Application window is maximized.

Where about / which event are you using to run the acCmdAppMaximize?
 
V

Van T. Dinh

That is what I was thinking also.

Try AutoExec macro and maximize the Access window application first and
opening the Form second.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top