Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Application directory


Message #1 by "Glen Yagami" <glenyagami@y...> on Fri, 13 Dec 2002 05:31:57
Is there a syntax in Access to determine application directory like VB 
App.Path? -- Glen
Message #2 by "Bob Bedell" <bobbedell15@m...> on Fri, 13 Dec 2002 15:23:25 +0000
Hi Glen,

The following snippets are functionally equivalent:

In VB~~~~~~~~~

Sub LoadPicture()
    imgPicture.Picture = LoadPicture(App.Path & "\5354.gif")
End Sub

In Access~~~~~

Sub LoadPicture()
    Me!olePicture.SourceDoc = CurrentProject.Path & "\5354.gif"
    Me!olePicture.Action = acOLECreateLink
End Sub

Interesting to note that App.Path is gone from VB.Net. Need to use stuff
like one of the following four:

System.Windows.Forms.Application.ExecutablePath
System.Windows.Forms.Application.StartupPath
System.AppDomain.CurrentDomain.BaseDirectory()
System.GetEntryAssembly().Location

Best,

Bob









>From: "Glen Yagami" <glenyagami@y...>
>Reply-To: "Access" <access@p...>
>To: "Access" <access@p...>
>Subject: [access] Application directory
>Date: Fri, 13 Dec 2002 05:31:57
>
>Is there a syntax in Access to determine application directory like VB
>App.Path? -- Glen


_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

Message #3 by "Bob Bedell" <bobbedell15@m...> on Fri, 13 Dec 2002 15:30:42 +0000
Should probably have mentioned that the CurrentProject object
is new with Access 2000.

>From: "Bob Bedell" <bobbedell15@m...>
>Reply-To: "Access" <access@p...>
>To: "Access" <access@p...>
>Subject: [access] Re: Application directory
>Date: Fri, 13 Dec 2002 15:23:25 +0000
>
>Hi Glen,
>
>The following snippets are functionally equivalent:
>
>In VB~~~~~~~~~
>
>Sub LoadPicture()
>    imgPicture.Picture = LoadPicture(App.Path & "\5354.gif")
>End Sub
>
>In Access~~~~~
>
>Sub LoadPicture()
>    Me!olePicture.SourceDoc = CurrentProject.Path & "\5354.gif"
>    Me!olePicture.Action = acOLECreateLink
>End Sub
>
>Interesting to note that App.Path is gone from VB.Net. Need to use stuff
>like one of the following four:
>
>System.Windows.Forms.Application.ExecutablePath
>System.Windows.Forms.Application.StartupPath
>System.AppDomain.CurrentDomain.BaseDirectory()
>System.GetEntryAssembly().Location
>
>Best,
>
>Bob
>
>
>
>
>
>
>
>
>
>>From: "Glen Yagami" <glenyagami@y...>
>>Reply-To: "Access" <access@p...>
>>To: "Access" <access@p...>
>>Subject: [access] Application directory
>>Date: Fri, 13 Dec 2002 05:31:57
>>
>>Is there a syntax in Access to determine application directory like VB
>>App.Path? -- Glen
>
>
>_________________________________________________________________
>Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
>http://join.msn.com/?page=features/featuredemail
>
>
>---
>Change your mail options at http://p2p.wrox.com/manager.asp or to 
>unsubscribe send a blank email to 


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

Message #4 by "Gerald, Rand" <RGerald@u...> on Fri, 13 Dec 2002 10:06:36 -0600
Hi Glen,

In Access 2K:

CurrentProject.Name:		The name of the .mdb file. (eg: Test.mdb)
CurrentProject.Path		The path of the .mdb file. (eg: C:\MyDir)
CurrentProject.FullName		The name of the .mdb file including the
path. (eg: C:\MyDir\Test.mdb)

I like to show CurrentProject.FullName on my startup form.  This is 
often
helpful to differentiate between development and production versions of 
the
database.

Rand E Gerald
Database Specialist
Information Services / Operations
Bah=E1'=ED National Office
1233 Central St.
Evanston IL 60201
(xxx) xxx-xxxx

-----Original Message-----
From: Glen Yagami [mailto:glenyagami@y...]
Sent: Thursday, December 12, 2002 23:32
To: Access
Subject: [access] Application directory

Is there a syntax in Access to determine application directory like VB
App.Path? -- Glen
Message #5 by "Charlie Goodwin" <cgoodwin@c...> on Fri, 13 Dec 2002 21:49:50 -0500
Glen,

Try:

CurrentDb.name      will give you the whole path ...
c:\Directory\MyDb.mdb

CurrentProject.Name     will give you your Db's name
without the full path   ...   MyDb.mdb

Charlie







> Is there a syntax in Access to determine application directory like VB
> App.Path? -- Glen

  Return to Index