I am trying to use excel as a database through QTP and trying to fetch records from it. I am running this code in windows 64 bit system and excel is 2010 version. Below is the code. Please help me what is the issue
Dim objCon, objRs
set objCon = createobject("ADODB.Connection")
objCon.Open "Provider = Microsoft.ACE.OLEDB.12.0;" & "Data Source = O:\Desktop\UFT\Testcases.xlsx;" & "Extended Properties = ""Excel 12.0 Xml;HDR = YES;"";"
Set objRs = createobject("ADODB.Recordset")
objRs.Open "select count(*) from Sheet1 where status = 'Fail'", objcon
msgbox objRs(0)
Set objCon = nothing
Set objRs = nothing