07-04-2013, 12:33 AM
I’ve been trying to figure out how to write the connection string (for a database which uses named instance) in QTP test scripts without success.
In a different computer where default named instance is used then the following works
but in a computer where instance name is used, I tried the followings:
but nothing works!!!
I’m wondering if anyone here can show me how to; I’d really appreciate your help.
Thanks in advance.
In a different computer where default named instance is used then the following works
Code:
cnt.ConnectionString= "Driver={SQL Server};Integrated Security=SSPI;Initial Catalog=cccccc;[b]Data Source=.[/b];UID=uuuuuu;PWD=pppppp;Trusted_connection=True"
but in a computer where instance name is used, I tried the followings:
Code:
cnt.ConnectionString= "Driver={SQL Server};Integrated Security=SSPI;Initial Catalog=cccccc;[b]Data Source=.\instance_name[/b];UID=uuuuuu;PWD=pppppp;Trusted_connection=True"
cnt.ConnectionString= "Driver={SQL Server};Integrated Security=SSPI;Initial Catalog=cccccc;[b]Data Source=computer_name\instance_name[/b];UID=uuuuuu;PWD=pppppp;Trusted_connection=True"
cnt.ConnectionString= "Driver={SQL Server};Integrated Security=SSPI;Initial Catalog=cccccc;[b]Data Source=computer_ipaddr\instance_name[/b];UID=uuuuuu;PWD=pppppp;Trusted_connection=True"
I’m wondering if anyone here can show me how to; I’d really appreciate your help.
Thanks in advance.