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.