Highlighted
Absent Member.
Absent Member.
9622 views

SQL server Connection String Format for QTP 11

Hi,
My ADODB Connection string is failing with QTP 11. It doesn't read the value for password and so fails to login. The same works in QTP 10. So i'm sure its the version. Did any of you figure out what's the right format? I wanted to save some time, if you already did the homework 🙂 Advance Thanks. I'll assign points for the right answer.

For me, the connection string format that works in QTP 10 is

"Provider=SQLOLEDB.1;Data Source=aaa;Initial Catalog=aaa;user id ='aaa';password= 'aaa'"
(This doesn't work in QTP 11)


The connection string format that worked in QTP 9 was
"Server=aaa;Database=aaa;UID=aaa;pwd=aaa;"
(This doesn't work in QTP 11)

 

 

P.S. This thread has been moevd from Quality Center Support and News Forum to Unified Functional Testing (formerly QTP) News and Support Forum. - Hp Forum Moderator

0 Likes
7 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Are you certain that you are using the same type of authentication on the new system?

I would check and make sure that your new system is also using SQL Server authentication for your user id. If it is using Windows Authentication you don't have to send the user id and password. See the Example connection string below.

Provider=SQLOLEDB.1;Data Source=aaa;Initial Catalog=aaa;Trusted_Connection=yes;

Hope that helps.

Aaron
0 Likes
Highlighted
Absent Member.
Absent Member.

Thanks for the response Aaron.
Its SQL Server authentication not Windows.

I was running scripts that used this connection successfully until I upgraded my system from QTP 10 to 11. I have other systems running the same script using QTP10 and it still works fine.

We upgraded another system to QTP11 and connection string fails there too.
0 Likes
Highlighted
Absent Member.
Absent Member.

Trincy, are you using this for a database checkpoint or within your QTP code?

QTP just uses VBScript processor for its VBScript, ODBC calls, so I would be suprised if there was any issue with it. Can you configure a machine DSN with all the connection settings and test it ourtside QTP, then use it inside QTP?
0 Likes
Highlighted
Absent Member.
Absent Member.

Its so annoying. I keep asking HP to send me sample script that uses adodb connection and will work with QTP11 and instead of sending it they are asking me all kind of useless questions.

A connection using a DSN works.
The connection from a vbs script works.(same code is used in the QTP script).

As I mentioned earlier, the connection used to work on this machine using QTP 10 and still works on all the other machine that uses QTP10.

It does work with QTP11. I believe they are not reading the value for password from the adodb connection string.


0 Likes
Highlighted
Absent Member.
Absent Member.

Const CONNECTION_STRING = "Driver={SQL Server};Server=C33C56131D03\rpoY_DEV_02;Database=proyyIntegrationTest;UID=;PWD="

 

Above is the DSN Less Connection string, which works for me in QTP 11 .

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi,

     I'm using QTP 11  when I was making connection with SQL Server 2005  my connection string failed, any one explain me what is the mistake below code. ........................

 

Dim Con, Rs

 

Set Con = CreateObject("adodb,connection")  ' (I'm facing problem in this line)

 

Set Rs = CreateObject("adodb.recordset")

 

Con.Open"Provider=sqloledb.1;server=Lalit-PC;uid=;pwd=;Database=Lalit_Data"

 

Rs.Open"Select * from Datadriven_Table", Con

 

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

I am also facing the same problem while connecting to SQL Server 2008 using QTP 11.0.

Please let me know if any mistake in below code:

"Provider=SQLOLEDB.1;Data Source=aaa;Initial Catalog=aaa;trusted_connecton =yes"

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.