Highlighted
Respected Contributor.
Respected Contributor.
1618 views

UFT 14.03 connection to Microsoft SQL SERVER

Jump to solution

Hello guys 🙂 

This time I wanna connect QTP to Sql server. I have tried above connection. But error occurs with my local user account. I have set configuration in sql to sql server connection but not windows authentication: 

2018-09-07_17-23-20.jpg

'Create ADODB connection object
Set objConnection = CreateObject("ADODB.Connection")
 
 'Create Recordsetobject
Set objRecordSet = CreateObject("ADODB.Recordset")
 
 'Connect to DB using provider and server
objConnection.open "provider=sqloledb;Server=servername ;User Id=username; Password=pass; Database=master;Trusted_Connection=Yes"

0 Likes
1 Solution

Accepted Solutions
Highlighted
Knowledge Partner
Knowledge Partner

Re: UFT 14.03 connection to Microsoft SQL SERVER

Jump to solution

Don't think you need the provider but I thnk you need a DSN, try something like this:

set ad = CreateObject("ADODB.Connection") 'create and open ODBC connection 
conStrDSN = "DSN=DSNName;UID=userid;PWD=password" 
ad.Open conStrDSN 

Mark SMith

View solution in original post

0 Likes
2 Replies
Highlighted
Respected Contributor.
Respected Contributor.

Re: UFT 14.03 connection to Microsoft SQL SERVER

Jump to solution

If there's any misunderstood thing please ask me below

and please give me any other connection or other way to connect UFT to sql server guys 🙂

 

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: UFT 14.03 connection to Microsoft SQL SERVER

Jump to solution

Don't think you need the provider but I thnk you need a DSN, try something like this:

set ad = CreateObject("ADODB.Connection") 'create and open ODBC connection 
conStrDSN = "DSN=DSNName;UID=userid;PWD=password" 
ad.Open conStrDSN 

Mark SMith

View solution in original post

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.