Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to start msaccess 2010 in runtime

19 REPLIES 19
Reply
Message 1 of 20
andre_lag
2469 Views, 19 Replies

How to start msaccess 2010 in runtime

Hello all,

 

I try to start msaccess in runtime mode, but an .accdr will not start.

this is the code try to use, without /runtime in the code the .mdb and .accdb works great

 

(startapp "C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSACCESS.EXE" /runtime path)

 

Anyone a idea?

thanks in advance

André

19 REPLIES 19
Message 2 of 20
Hallex
in reply to: andre_lag

Try something like this:

(if (findfile (setq msfile "C:\\Program Files\\Microsoft Office 15\\root\\office15\\MSACCESS.EXE"))
(startapp "C:\\Program Files\\Microsoft Office 15\\root\\office15\\MSACCESS.EXE" (strcat (getvar "dwgprefix") "NewDBTest.accdb"))
(alert "Check for existing MSACCESS.EXE file on your PC"))

 Change expression to your settings

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 3 of 20
andre_lag
in reply to: andre_lag

Hello Hallex,

 

Thanks for your reply.

It works great so far, but if i change the extention from accdb to accdr it won't launch anymore.

Use the runtime modus to hide the navigation pane and menu's so that nobody can change tables, forms, etc. 

Read somthing on the web about to use a switch in the command-line?

Think that is not applicable for lisp.

How can i launch a runtime db with lisp?

 

André

 

 

   

 

Message 4 of 20
Hallex
in reply to: andre_lag

Sorry, André
I could not resolve this issue on my end 😞
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 5 of 20
hgasty1001
in reply to: andre_lag

Hi,

 

I'm not sure, but if you put the access start command and switches in a batch file, you can use 

(acet-sys-command "the .bat file")

 

Gaston Nunez

 

 

Message 6 of 20
hmsilva
in reply to: andre_lag

André,

 

I couldn't test, but from the Access help, first the path followed by the parameters...

It may be something like

 

(startapp "C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSACCESS.EXE"  path /runtime)

 

Henrique

EESignature

Message 7 of 20
andre_lag
in reply to: andre_lag

Thanks Henrique,

 

I have try this, but doesn't work.

the only answer on the command-line is nil.

 

André

Message 8 of 20
hmsilva
in reply to: andre_lag


andre_lag wrote:

 ...

I try to start msaccess in runtime mode, but an .accdr will not start.

this is the code try to use, without /runtime in the code the .mdb and .accdb works great

 

(startapp "C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSACCESS.EXE" /runtime path)

 

...


Andre,

one last attempt, again without being able to test (I don't have acess in this pc), and again from the help,

"if you double click on the .accdr file and Access will load in Runtime mode."

 

So, if you use

(startapp "C:\\Program Files (x86)\\Microsoft Office\\Office14\\MSACCESS.EXE" "c:\\MyPath\\MyDatabase.accdr")

without the runtime switch, should load in Runtime mode...

 

Henrique

EESignature

Message 9 of 20
andre_lag
in reply to: andre_lag

Henrique,

 

Thanks again.

Access launched but give an error message and said that

i must use the switch /runtime in the command-line.

 

i give up and try somthing else like use accdb and than hide the navigation pane

and the menu's.

 

Thanks,

André

  

Message 10 of 20
hmsilva
in reply to: andre_lag

Sorry André,
I was not much help...

Henrique

EESignature

Message 11 of 20
andre_lag
in reply to: andre_lag

Hi Gasty,
Made a batch file and it works as you said,
and guess what? it works only wthout switches.
Thanks
Andre
Message 12 of 20
hgasty1001
in reply to: andre_lag

Hi,

 

It's working here, this is the only line in the batch:

 

"C:/Program Files/Microsoft Office/Office14/msaccess.exe" "C:/Dev/Access/FrmSampl.accdr" /runtime

 

I call the batch using the acet-sys-command : (acet-sys-command "C:/Dev/Access/access.bat")

 

Hope this help.

 

Gaston Nunez

 

Message 13 of 20
andre_lag
in reply to: andre_lag

Hi Gaston,

 

Thanks, works great.

I use the database with ac electrical in several projects, get with API the active project

and want that written in the batch file.

Is it possible that autolisp make a batch file in the active projectfolder?

Like:

"C:/Program Files/Microsoft Office/Office14/msaccess.exe" "C:/Dev/ACT_PRJ.accdr" /runtime

 

ACT_PRJ is then the actual project folder.

 

Thanks

André

 

  

Message 14 of 20
hmsilva
in reply to: andre_lag

André just a thought,

if you double click on the .accdr file and Access will load in Runtime mode,

did you try to load in Runtime mode using a shell, perhaps something like this

(command "sh" (strcat "\"C:/Dev/ACT_PRJ.accdr\""))

 

Henrique

EESignature

Message 15 of 20
hgasty1001
in reply to: andre_lag

Hi,

 

This little lisp should write the batch for you:

 

(defun CreateAccessBatch(AccessExePath dbPath accdrFileName / fp StrLine BatchFileName)
  (setq BatchFileName (strcat dbpath accdrFileName ".bat"))
  (setq fp (open BatchFileName "w"))
  (if fp
    (progn
      (setq StrLine (strcat (chr 34) accessExePath (chr 34) " " (chr 34) dbpath ".accdr" (chr 34) "/runtime")) 
      (write-line StrLine fp)
      (close fp)
    )
  )
)

 

 I think the arguments are self explanatory, but the call in this case should be:

 

(CreateAccessBatch "C:/Program Files/Microsoft Office/Office14/msaccess.exe" "C:/dev/" "ACT_PRJ")

 

Glad to help.

 

Gaston Nunez

 

 

Message 16 of 20
andre_lag
in reply to: andre_lag

Hi Gaston,

 

Thanks for your reply, it works great until to launch bat file, will attach the file

acet-sys-command won't work, try with the full path as well as you can see.

An doubleclick on the bat file works

can you help?

 

 

 

 

Message 17 of 20
andre_lag
in reply to: andre_lag

Sorry guys, it take some time.

I solved this problem, stupid i am so easely

with (startapp....)

thanks to all for the help

regards

André

 

Message 18 of 20
hmsilva
in reply to: andre_lag


@andre_lag wrote:

Sorry guys, it take some time.

I solved this problem, stupid i am so easely

with (startapp....)

...

 


André,

 

if possible, share with us the solution ,it  can be helpful to others in the same situation...

 

Henrique

EESignature

Message 19 of 20
andre_lag
in reply to: andre_lag

Hi, everyone

 

Of course, sorry, I will be more careful next time to share the solution(s)

Use (startapp BatchFileName) instead of (acet-sys-command BatchfileName)

acet-sys-command did'nt work in my case.

Changed some variable names and use API from ace, but i think the attached code is clear.

At the end need to close the cmd-window, because it stay's open during the access session.

 

Regards and thanks again guys,

 

andré

 

Message 20 of 20
hmsilva
in reply to: andre_lag

André,

many thanks for sharing your solution with us.

Cheers
Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost