Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you RUN the Access Runtime environment

Status
Not open for further replies.

a2ross

Programmer
Joined
Dec 6, 2000
Messages
69
Location
AU
I know it may sound dumb but what actually runs in the Access runtime environment distributed by the ODE tools 97 package?

I have packaged a 97 .mdb using the ODE tools and chose the run time environment to be included. I installed the package on a test machine. It added several .dlls and a shortcut to the .mdb as requested. When attempting to run the .mdb I get the usually box that appears when Windows doesn't know what exe to use for openning a particular file.

Am I missing something here or did the packaging wizard omit an exe file as part of the package.

BTW the test machine is running XP home. I believe the client's target machine is running the same.

Any help would be most appreciated.

Arthur.
 
From what I understand the Access run time environment are all the Access libraries and files required to run Access. What it does not includeis the AccessUI. Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com
 
That is my understanding also. The problem is that the file didn't run. Windows asked for the program to use to open my file (?????.mdb) just the same as it would if I hadn't installed any runtime environment at all.

There are a number of .dlls that have been installed but no exe file. Does anyone know

a) if there should be an exe file?
b) if not, what is the process for running my .mdb file using the runtime environment?

Arthur.
 
Ok if you want to run your MDB file under runtime.

If the machine has office 97 already on it you can expect that when you click on your MDB file it will run your app under Access 97 rather than Runtime. When office was installed the association for the MDB file will have been set to Access 97 and not runtime for obvious reasons.

OK how to set the MDB file to runtime and not Access 97 well this will depend on the use of the MDB if you plan on distributing the MDB in package form then you will have to write a small VB app to do so. If you plan on using it on your own system you can change the association of the MDB to Runtime rather than Access 97.


NOTE: the problem with this is that once you change the associations you will not be able to edit the MDB unless you load it via the Access 97 program, in other words if you hold down the shift key and open the app it will open the app in Runtime mode and you will not be able to do anything with it.


How to write a VB app to run the file, well if you know how to use VB then what you need to do is check the registry and find out where the program is stored.

REASON: If the user has placed Runtime in a different Directory you will get errors, so the best way to load it is through the registry.

Now I use Runtime2000 and I know where the registry link is for it but I do not have Access97 anymore so you will have to look through the registry to find the relevant links to put into the following code.

Private Declare Function WinExec Lib "kernel32" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long

Option Explicit

Private Const REG_DWORD As Long = 4
Private Const HKEY_CLASSES_ROOT = &H80000000

Private Declare Function RegOpenKey Lib "advapi32.dll" _
Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal _
lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegQueryValueEx Lib "advapi32.dll" _
Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal _
lpValueName As String, ByVal lpReserved As Long, _
lpType As Long, ByVal lpData As String, lpcbData _
As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" _
(ByVal hKey As Long) As Long

Private Function ReadRegistry(ByVal Group _
As Long, ByVal Section As String, ByVal Key _
As String) As String

Dim lResult As Long, lKeyValue As Long, _
lDataTypeValue As Long, lValueLength As Long, _
sValue As String, td As Double

On Error Resume Next
lResult = RegOpenKey(Group, Section, lKeyValue)
sValue = Space$(2048)
lValueLength = Len(sValue)
lResult = RegQueryValueEx(lKeyValue, Key, 0&, _
lDataTypeValue, sValue, lValueLength)
If (lResult = 0) And (Err.Number = 0) Then
If lDataTypeValue = REG_DWORD Then
td = Asc(Mid$(sValue, 1, 1)) + &H100& * _
Asc(Mid$(sValue, 2, 1)) + &H10000 * _
Asc(Mid$(sValue, 3, 1)) + &H1000000 * _
CDbl(Asc(Mid$(sValue, 4, 1)))
sValue = Format$(td, "000")
End If
sValue = Left$(sValue, lValueLength - 1)
Else
sValue = "Not Found"
End If
lResult = RegCloseKey(lKeyValue)
ReadRegistry = sValue
End Function
'----------------------------------------------------------

'Ok if you have placed the above code in a form you will have most of ot done the next bit is to place the next bit on say the load event or on_open event that way when the EXE file is run it will run the program for you.

'On Form Open
Private Sub sampleLabel_Click(Index As Integer)
Dim sname As String
Dim spath As String
On Error Resume Next
'this next line you will have to check in the registry
sname = "access.application.9"
spath = ReadRegistry(HKEY_CLASSES_ROOT, sname & "\shell\open\command", "")
spath = Left(spath, InStr(1, spath, " ""%1""") - 1)
'Load the Access file with Runtime
Shell spath & " " & """c:\progra~1\sample\sample.mde""", 3
unload me
End Sub

'Hope this Helps let me know how you go
'ZeroAnarchy
 
Thanks for the suggestion. I'll follow it through. It may take a while as I'm not very familiar with operating with registry values.

This does however sound like a work around for an unusual situation. I would like to know how a simple distribution of an .mdb (or .mde) file with the runtime environment is supposed to work.

The target machine does not have Access any version on it which is why I want to distribute the runtime in the first place.

When I use the wizard to make an installation package containing my database and the Access runtime environment and install it on the target machine, nothing runs.

That's my problem.

I've searched the forums and found heaps of posts (20 plus) that simply say "use the ODE tools to package the runtime environment with your database and install it on a client machine". This is what I want to do but can't find the instructions of exactly how to achieve it or what I'm currently doing wrong.

Arthur.
 
Art, yes the RUNTIME package SHOULD include an executable to get Access/RT up and "running", so to speak. A bunch of DLLs ain't gonna do it without a stub to get them started.

Something fell off the back of the truck on the way to the circus - try recreating your run time package, and make sure you haven't unchecked an option that might have EXCLUDED your Access executable file being included....

Jim
How many of you believe in telekinesis? Raise my hand...
Another free Access forum:
More Access stuff at
 
Partially solved the problem and feel a little sheepish.

I discovered that during the setup wizard, although the "access runtime" option is highlighted in the list of options to include in the package, it is not actually selected. You have to click on it again to place a little cross next to it.

Now I do get an executable and a whole lot of other stuff to go along with it. Just need to get to the target machine now and see how it goes.

I let you know for anyone else reading this who may be interested.

Arthur.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top