|
 |
access thread: Open Access dbse in Access dbse
Message #1 by "Steven Van Aken" <svanaken@m...> on Thu, 18 Apr 2002 17:28:35
|
|
Hello,
How can I open an Access database in an Access database, and returning to
the first Access database when the second is closed?
Message #2 by "John Ruff" <papparuff@c...> on Thu, 18 Apr 2002 10:19:20 -0700
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0022_01C1E6C2.816D6A80
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
This comes from Microsoft Knowledgebase article Q209876
Option Explicit
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _
hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CreateProcessA Lib "kernel32" (ByVal _
lpApplicationName As Long, ByVal lpCommandLine As String, ByVal _
lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _
lpStartupInfo As STARTUPINFO, lpProcessInformation As _
PROCESS_INFORMATION) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal _
hObject As Long) As Long
Private Const NORMAL_PRIORITY_CLASS = &H20&
Private Const INFINITE = -1&
Public Sub ExecCmd(cmdline$)
Dim proc As PROCESS_INFORMATION
Dim start As STARTUPINFO
Dim ReturnValue As Integer
'Stop
' Initialize the STARTUPINFO structure:
start.cb = Len(start)
' Start the shelled application:
ReturnValue = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
' Wait for the shelled application to finish:
Do
ReturnValue = WaitForSingleObject(proc.hProcess, 0)
DoEvents
Loop Until ReturnValue <> 258
ReturnValue = CloseHandle(proc.hProcess)
End Sub
Public Sub OpenAnotherProgram()
ExecCmd "c:\windows\NOTEPAD.EXE"
MsgBox "Process Finished"
End Sub
John Ruff - The Eternal Optimist :-)
Always looking for Contract Opportunities
9306 Farwest Dr SW
Lakewood, WA 98498
papparuff@c...
-----Original Message-----
From: Steven Van Aken [mailto:svanaken@m...]
Sent: Thursday, April 18, 2002 5:29 PM
To: Access
Subject: [access] Open Access dbse in Access dbse
Hello,
How can I open an Access database in an Access database, and returning
to
the first Access database when the second is closed?
Message #3 by "Steven Van Aken" <svanaken@m...> on Fri, 19 Apr 2002 07:44:17
|
|
I created this module, ran it but it did nothing.
------=_NextPart_000_0022_01C1E6C2.816D6A80
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
This comes from Microsoft Knowledgebase article Q209876
Option Explicit
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadID As Long
End Type
Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal _
hHandle As Long, ByVal dwMilliseconds As Long) As Long
Private Declare Function CreateProcessA Lib "kernel32" (ByVal _
lpApplicationName As Long, ByVal lpCommandLine As String, ByVal _
lpProcessAttributes As Long, ByVal lpThreadAttributes As Long, _
ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, _
ByVal lpEnvironment As Long, ByVal lpCurrentDirectory As Long, _
lpStartupInfo As STARTUPINFO, lpProcessInformation As _
PROCESS_INFORMATION) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal _
hObject As Long) As Long
Private Const NORMAL_PRIORITY_CLASS = &H20&
Private Const INFINITE = -1&
Public Sub ExecCmd(cmdline$)
Dim proc As PROCESS_INFORMATION
Dim start As STARTUPINFO
Dim ReturnValue As Integer
'Stop
' Initialize the STARTUPINFO structure:
start.cb = Len(start)
' Start the shelled application:
ReturnValue = CreateProcessA(0&, cmdline$, 0&, 0&, 1&, _
NORMAL_PRIORITY_CLASS, 0&, 0&, start, proc)
' Wait for the shelled application to finish:
Do
ReturnValue = WaitForSingleObject(proc.hProcess, 0)
DoEvents
Loop Until ReturnValue <> 258
ReturnValue = CloseHandle(proc.hProcess)
End Sub
Public Sub OpenAnotherProgram()
ExecCmd "c:\windows\NOTEPAD.EXE"
MsgBox "Process Finished"
End Sub
John Ruff - The Eternal Optimist :-)
Always looking for Contract Opportunities
9306 Farwest Dr SW
Lakewood, WA 98498
papparuff@c...
-----Original Message-----
From: Steven Van Aken [mailto:svanaken@m...]
Sent: Thursday, April 18, 2002 5:29 PM
To: Access
Subject: [access] Open Access dbse in Access dbse
Hello,
How can I open an Access database in an Access database, and returning
to
the first Access database when the second is closed?
|
|
 |