[AccessD] Access and VB6 question

Stuart McLachlan stuart at lexacorp.com.pg
Tue Apr 15 17:47:48 CDT 2003


If you can't predict the pass to Access, you can achieve the same 
thing using ShellExecute()

Public Declare Function ShellExecute Lib "shell32.dll" Alias 
"ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, 
ByVal lpFile As String, ByVal lpParameters As String, ByVal 
lpDirectory As String, ByVal nShowCmd As Long) As Long

ShellExecute(0,"Open","C:\Full\Path\To\YourApp.mdb"","","",1)

The 1 =  Show_Normal, you could also use 3 for Show_Maximized

On 15 Apr 2003 at 11:44, Seth Galitzer wrote:

> Jeff,
> 
> This is actually very easy.  Just use the Shell() function to open
> Access with a particular mdb, just like in a shortcut.  The execution
> string would be something like:
> 
> """C:\Full\Path\To\msaccess.exe"" ""C:\Full\Path\To\YourApp.mdb"""
> 
> If you want additional commandline flags, jsut add them to the string.
> 
> If you don't include code in your VB app to close after shelling out,
> then it will be open when you close the Access app.
> 
> Seth
> 
> On Tue, 2003-04-15 at 10:39, Jeff Barrows wrote:
> > I need to be able to open an Access 2k front end from a VB6
> > application.  I want the users to click a button on my VB form and
> > have the code open the Access FE in front of the VB app.  Then, when
> > we close the Access app, the VB app is already there.  Can anyone
> > help me with this?
> >  
> > Jeff Barrows
> > Outbak Technologies, LLC
> > jeff at outbaktech.com
> 
> -- 
> Seth Galitzer			sgsax at ksu.edu
> Computing Specialist		http://puma.agron.ksu.edu/~sgsax
> Dept. of Plant Pathology
> Kansas State University
> 
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com


-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.





More information about the AccessD mailing list