Can’t get QTP 11 to work with database

  • Questions
  • Can't get QTP 11 to work with database
Question ID: 105159
0
0

I used to be able to connect my QTP 11 to Oracle and SQL Server on my old Windows XP machine. Now we’ve upgraded to Windows 7 64 bit, and my scripts fail when trying to execute an Open command on my database object. I’ve checked my connection string on connectionstrings.com and it looks correct. Any ideas?

Marked as spam
Posted by (Questions: 175, Answers: 22)
Asked on October 31, 2013 2:02 pm
4 views
Answers (2)
1
Private answer

64 bit database drivers are still not supported by QTP 11. There is an open enhancement request regarding this with HP.

As a workaround, what has worked for some users is to launch the 32 bit ODBC manager and to create a System DSN entry that has the 32 bit driver. This is not guaranteed to work as some client installs do not have the 32 bit driver anymore for whatever reason, but it's worth a try:

1. Launch the 32 bit ODBC Data Source Administrator (navigate to: C:WindowsSysWOW64odbcad32.exe)
*The default ODBC Data Source Administrator on Windows 64 bit in the Control Panel launches the 64 bit tool, which is not yet compatible with UFT 11.5x

2. Click on System DSN tab

3. Click the Add button

4. Scroll through the list until you find the database driver you want to use and click it

5. Click Finish to select the driver

6. Create a name for the database connection. This will be used for the connection string in UFT 11.5x (I wouldn't use spaces, such as ''Test_DSN'')

7. Fill out the rest of the database information that is presented. This can vary depending on the database type/version

8. Continue clicking the next button and filling out any required information

9. Once completed, you will now see your DSN entry in the System DSN area

10. You can now connect to the database using the DSN. For example:

set MyDB = CreateObject(''ADODB.Connection'')

MyDB.Open ''''

---- more script code -------

MyDB.Close

or simply

connectDSN = ''''
set MyDB = CreateObject(''ADODB.Connection'')
MyDB.Open (connectDSN)
----- more script code ------

MyDB.Close

Marked as spam
Posted by (Questions: 2, Answers: 425)
Answered on October 31, 2013 2:07 pm
0
Private answer

That worked. Thanks

Marked as spam
Posted by (Questions: 175, Answers: 22)
Answered on October 31, 2013 2:30 pm