我正在尝试通过 QTP 使用 excel 作为数据库并尝试从中获取记录。我在 Windows 64 位系统中运行此代码,excel 是 2010 版本。下面是代码。请帮助我这是什么问题
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