New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.
Absent Member.
6861 views

How to connect to IBM DB2 Database using QTP 9.5

How to connect to IBM DB2 Database using QTP 9.5. could you please let me know what are intial setup to be done on machine to access the database thro QTP using ODBC connection String.
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

http://connectionstrings.com/?carrier=ibmdb2

query = "select * from tablename"

ConStr = "Driver={IBM DB2 ODBC DRIVER};Database=myDataBase;Hostname=myServerAddress;Port=1234; Protocol=TCPIP;Uid=myUsername;Pwd=myPassword;"

Set conn1 = CreateObject("ADODB.Connection")
Set thisObjRS = CreateObject("ADODB.recordset")

conn1.ConnectionString = ConStr
conn1.Open
Set rs = conn1.Execute(query,,adExecuteNoRecords)
0 Likes
Highlighted
Absent Member.
Absent Member.

Thanks for the post.

The DB2 connection is working, but can you provide the step to run the queries.
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.