UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> OpenCurrentDatabase - Runtime Access    
 
   
tunkefer
post May 18 2007, 07:43 AM
Post #1

UtterAccess Guru
Posts: 568
From: Cleveland, OH



In another thread, the following code snip was offered as a way to open an external Access application in a way that its forms can be referenced:

Dim objAccess as Object
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase "C:\YourPath\YourDB.mdb"
objAccess.Visible = True
objAccess.Docmd.OpenForm "YourFormName"

In the OpenCurrentDatabase command, can a reference to Runtime Access be included? In other words, is the path string evaluated as a DOS command or only as a file reference?
Go to the top of the page
 
+
LPurvis
post May 18 2007, 08:11 AM
Post #2

UtterAccess Editor
Posts: 13,750
From: England (North East / South Yorks)



You launch Access in runtime mode - not a database file.
It's why you have it as an argument in the command line - which is passed to the MSAccess executable - not the file mdb.

Are you just wanting to launch an instance of an mdb in runtime mode?
Why do you want to?
Are you not running under a runtime installation?
Go to the top of the page
 
+
tunkefer
post May 18 2007, 11:37 AM
Post #3

UtterAccess Guru
Posts: 568
From: Cleveland, OH



Yes, I want to launch an instance of an mdb in runtime mode. I am developing a set of applications that will be deployed in a mixed environment. That is, there are multiple users with varying versions of Access, from Access 98 thru 2003, so I install these applications with Access runtime.

In order to make sure my installed version of Access runtime is used to execute my application, I build a shortcut that specifies the installed Runtime software to be used. I want to do the same for a second application launched from the first and still retain a reference to it from the first application so I can manipulate a form in the second.
Go to the top of the page
 
+
LPurvis
post May 18 2007, 11:41 AM
Post #4

UtterAccess Editor
Posts: 13,750
From: England (North East / South Yorks)



Are you essentially meaning that a machine might have many different version of Access (97 to 2003) installed, all as part of a runtime installation?
Or there might be, say, a 97 retail install - but you've propagated 2003 runtime installs throughout - and you want to launch the 2003 version of Access?

(Or that there might be the retail and runtime mode available for a given version)?
Go to the top of the page
 
+
tunkefer
post May 18 2007, 11:51 AM
Post #5

UtterAccess Guru
Posts: 568
From: Cleveland, OH



There might be, and probably is, a version of Access on the target PC but it could be any version. My installation package installs Runtime Access 2003. The target string of desktop shortcut the package installs specifies that the package-installed Runtime Access be used. The shortcut target string looks something like:
"C:Program Files\Microsoft Office\Office11\msaccess.exe /runtime C:\MyPath\MyMDB.mdb"
This works fine.

I want to able to launch the same application from another Access application with the same assurance that it will execute under my Runtime Access but I also want to be able to reference that instance from the first application so I can manipulate a form. In other words, can I use a similar string to the above in the OpenCurrentDatabase command?
Go to the top of the page
 
+
LPurvis
post May 18 2007, 12:05 PM
Post #6

UtterAccess Editor
Posts: 13,750
From: England (North East / South Yorks)



I know you keep focussing on the *runtime* version running, but is there a particular reason for this?
Is it not just a case of wanting an Access 2003 instance to run your database?
(Bearing in mind that the runtime is only a *mode* of Access - it's still all Access, the same executable).
Go to the top of the page
 
+
tunkefer
post May 18 2007, 12:13 PM
Post #7

UtterAccess Guru
Posts: 568
From: Cleveland, OH



Yes it is a case of wanting an instance of Access 2003 to run the database. But in the code:
Dim objAccess as Object
Set objAccess = CreateObject("Access.Application")
it seems to me that if a different version of retail Access is already installed on the PC, I'm going to get that version of Access, not the Runtime Access 2003 that my installer package has installed. So I'm looking for a way to make sure I get an instance of Access 2003 to execute.
Go to the top of the page
 
+
LPurvis
post May 18 2007, 12:17 PM
Post #8

UtterAccess Editor
Posts: 13,750
From: England (North East / South Yorks)



You can specify the version in the CreateObject method

Set objAccess = CreateObject("Access.Application.11")

(For Access 2003 - which is version 11 of course :-)
Go to the top of the page
 
+
tunkefer
post May 18 2007, 12:18 PM
Post #9

UtterAccess Guru
Posts: 568
From: Cleveland, OH



OK. Thanks.
Go to the top of the page
 
+
LPurvis
post May 18 2007, 12:21 PM
Post #10

UtterAccess Editor
Posts: 13,750
From: England (North East / South Yorks)



No probs - see how you get on with it.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 11:00 PM