Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic DSN 1

Status
Not open for further replies.

hitechboy78737

Programmer
Nov 8, 2004
82
US
As I understand it, the Application.Startup path is a different value in debug builds and release builds.

I've solved the problem by stripping off the "\bin" and adding "<insert data string here>", knowing that I have to change this when I build a release.

First, do I have this concept right?

Secondly, Couldn't I look at some property to see if the build is release or debug and set the string accordingly? If so, what would this magic property be?


Code:
strMagicProp = somenamespace.MagicProperty
if strMagicProp = "debug" then
  <insert debug DSN string>
elseif strMagicProp = "release" then
  <insert release DSN string>
else
     PUNT!
end if

Thanks!
Kevin Howell

 
Yes you can do it, using conditional compiler directives.

Code:
dim strDSN as string = releaseDSNString

#If DEBUG Then
        strDSN = DebugDSNString
#End If

In this example we set the DSN string to the release version by default, then we test for DEBUG mode and if necessary override the default DSN string with out test one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top