Here are the steps to install an ODBC driver for InterSystem's Cache database and code to connect and execute a query in QTP.
1. Install the ODBCDriver.exe Client ODBC Driver Install Instersystems
2. Go to your Control Panel\Administrative Tools\Data Sources (ODBC)
3. Go to User DSN and click on Add:
5. Fill in the following info:
6. Open QTP and enter the following code:
Dim dbexample Dim sqlQuery ' Create the conection object. Set dbexample = CreateObject("ADODB.Connection") dbexample.Open("DSN=CACHE") 'Your query info will be different sqlQuery = "Select Reg.Pat.PatientNm, Reg.Pat.Mrn From Reg.Pat" ' Get the recordset returned from a select query. Set recordset = dbexample.Execute(sqlQuery) ' Display the results of the query. print recordset.GetString ' Close the database connection. dbexample.Close Set dbexample = Nothing