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