Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / IDE / January 2006

Tip: Looking for answers? Try searching our database.

DataDirectory macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chuck P - 13 Jan 2006 19:44 GMT
Is there a way to permanently kill or make disfunctional the
DataDirectory macro.  When I put a connection string in Settings I
really don't want some Macro messing with it.

http://blogs.msdn.com/smartclientdata/archive/2005/08/26/456886.aspx
"Gary Chang[MSFT]" - 16 Jan 2006 06:38 GMT
Hi Chuck,

>Is there a way to permanently kill or make disfunctional
>the DataDirectory macro.  When I put a connection string
> in Settings I really don't want some Macro messing with it.

Based on the description, it seems you may use the "DataDirectory" as the
target directory on your connection string, so you concern about the
DataDirectory macro will mess up with your same hardcoded directory name.
Please let me know if I have misunderstood anything.

If so, I think you don't need to worry about that, for the reason that the
VS2005 will take the "DataDirectory" as a macro identifier only if it is
embraced by a couple of '|'---"|DataDirectory|", but for a name of
directory or file, it cannot contain the character '|', so in this point,
the macro "|DataDirectory|" would not be messed up with your hardcoded
directory name.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.
Chuck P - 19 Jan 2006 19:52 GMT
I agree it should not mess me up, but it does.  Sometimes VS does what it
wants, and automatically changes my code for me. :(

The problem I have is that the Macro changes the path I put into the
connection string.
If I have a local Access Database and I put in a path of ..\dbname.mdb
When I go to debug the program it errors out.
If I look at the connection string stored and find it was magically changed
to:  |DataDirectory|.
I would like to keep VS from changing it.

> Hi Chuck,
>
[quoted text clipped - 27 lines]
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
"Gary Chang[MSFT]" - 23 Jan 2006 09:58 GMT
Hi Chuck,

I am afraid this behavior is by design in VS2005, the path in the
ConnectionString's AttachDBFilename should be absolute or relative by using
the DataDirectory substitution string, so the VS2005 will change your
relative path to |DataDirectory| automatically.

I will forward your concern to the corresponding product team to review
this behavior, but current there isn't an option in VS2005 to disable it.

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Community Support
--------------------
Get Secure! ¡§C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.