all groups > visual studio .net enterprise tools > august 2006 >
You're in the

visual studio .net enterprise tools

group:

cannot change data source connection string in web tests


cannot change data source connection string in web tests ksultz
8/17/2006 1:32:02 PM
visual studio .net enterprise tools:
I'm using Visual Studio 2005 Team Edition for Testers. I create a web test
script (webtest1.webtest) and record several http steps. Then I add a data
source directly in the web test (not the project/solution) which uses the Jet
4.0 OLE DB Provider. The data source includes an absolute path to a local
MSAccess mdb file, such as

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\projectpath\XML.mdb;Persist
Security Info=False

When the web test runs, it connects to the mdb, gets the first record from a
table, uses that data for certain http parameters, repeat for next record(s)
until done. It all works fine on my PC, so I save the files to Source
Control.

But when I retrieve the files from Source Control to another PC which has a
different project path (C:\otherpath\projectpath), the web test cannot run
because it can't find the mdb file. In the Visual Studio IDE the connection
string property in the .webtest script is read-only so I can't modify it. I
tried using a text editor to modify that property in the script, but the
actual connection string seems to be stored encrypted.

I also tried creating a new data source with a relative path in the
connection string such as Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=XML.mdb;Persist Security Info=False. That works for test creation but
not execution; VS apparently uses a different working directory for test
execution results, and the mdb file is not found there.

So far I have only found 2 workarounds, and both are messy:
1. Require all the local project files (including mdb) to exist at the same
absolute path on all computers.
2. On each computer, remove the data source and all field bindings in each
web test, then remake the data source and reconnect all the bindings (not
practical).

I would like to know if there is a way to specify a dynamic (non-literal)
path in the connection string that points to the project directory, such as:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source={ProjectDir}XML.mdb;Persist
Security Info=False

RE: cannot change data source connection string in web tests v-garych NO[at]SPAM online.microsoft.com (
8/18/2006 3:53:29 AM
Hi

[quoted text, click to view]

Since the data source is setup up by the wizard, I am afraid there is no
ways to specify a dynamic path in the connection string which created by
the VS2005 wizard.

In this regard, maybe we need to look for some other approaches to this
case. Would you please tell me how do you use the data source in your web
test?

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

RE: cannot change data source connection string in web tests v-garych NO[at]SPAM online.microsoft.com (
8/22/2006 3:18:28 AM
Hi,

How are the thing going?

I appreciate your can provide the infomation to let us follow this issue.
If you have any issues or concerns please let me know. I will be happy to
be of further assistance.

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
AddThis Social Bookmark Button