Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = &H0001
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordSet = CreateObject("ADODB.Recordset")
'指定连接字符串
objConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=E:\test\result.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes;"";"
objRecordset.Open "Select * FROM [Sheet1$]", _
objConnection, adOpenStatic, adLockOptimistic, adCmdText
strSearchCriteria = "TestcaseNum = '3.1.1'"
objRecordSet.Find strSearchCriteria
objRecordset("Result") = model1
strSearchCriteria = "TestcaseNum = '3.3.6'"
objRecordSet.Find strSearchCriteria
objRecordset("Result") = TestResult
objRecordset.Update
objRecordset.Close
objConnection.Close
在线等答案,有哪位高手帮我分析一下呀?
參考答案:没有问题呀~@!~@%^ 你看看你引用了ado控件了没有