design and compiled file paths

T

thomasp

Using VB 2005 beta 2

1. If I have a connection string of "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=|DataDirectory|\Database\TAM.mdb;Persist Security Info=True", what
directory will this point to once the file is compiled and running on a
user's system?

2. What path will the following code point to?
strAppPath = Trim(Application.StartupPath & "\")
strAppPath.Trim()
Me.HelpProvider1.HelpNamespace = strAppPath & "Help\TAMS.chm"

I want my Database files, Help Files, and Report files to be in directories
under the install directory of the program when it is distributed.

Thanks,

Thomas
 
P

Phill. W

1. If I have a connection string of "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=|DataDirectory|\Database\TAM.mdb;Persist Security Info=True",
what directory will this point to once the file is compiled and running
on a user's system?

Whatever you've /hard-coded/ in place of "|DataDirectory|".
2. What path will the following code point to?
strAppPath = Trim(Application.StartupPath & "\")
strAppPath.Trim()
Me.HelpProvider1.HelpNamespace = strAppPath & "Help\TAMS.chm"

Me.HelpProvider1.HelpNamespace _
= IO.Path.Combine( Application.StartupPath, "Help\TAMS.chm" )

will point to the "Help" directory below the "Start In" directory specified
on the shortcut that started the application.

IIRC,

Reflection.Assembly.GetEntryAssembly.Location

will get you the physical path where the executable resides.

HTH,
Phill W.
 
T

thomasp

Thanks for the info.

I have not hard coded anything in place of "|DataDirectory|", this is what
VB coded when I created a connection to the database. I am just wondering
where it will point when the software is deployed???? The other answers
were very helpful.


Whatever you've /hard-coded/ in place of "|DataDirectory|".

Thanks,


Thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top