How does one connect QTP/UFT to an external database?
I was just asked this question.
I have done this many times in past.
My mind went blank except for saying you can connect to the ADO object with the connection strings for the database type.
What is the object called?
I also said that I can connect through the windows operating system by putting the information in the container that holds this information. Then use this name in the code.
Something like this:
strConnectionSettings = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strWorkBook & ";Extended Properties=" & Chr(34) & "Excel 8.0;HDR=Yes;"
If blnReadOnly Then
strConnectionSettings = strConnectionSettings & "IMEX=1"
strConnectionSettings = strConnectionSettings & Chr(34) & ";"
Set objConnection = CreateObject("ADODB.Connection")
Set objRecord = CreateObject("ADODB.Recordset")
The basic idea is Microsoft .net framework has ODBC, and most popular databases has a connector that'll allow that database to hook up with ODBC. With an ODBC database, you can use VBScript to connect with what the previous poster mentioned above.
The information above is what I said when asked.
I was thinking back the WinRunner days. I figured that there may have been special Methods such as connect and disconnect that I forgot about.