1:ADODB方式
Function GetConfig(sConfigFile, sSheet,sCaseId)
' Call PrintLog(Now, LOG_STATUS_INFO, "GetConfig(" & sConfigFile & "," & sSheet & ")")
Dim oDictionary, oConnection
Set oDictionary = CreateObject("Scripting.Dictionary")
Set oConnection = CreateObject("ADODB.Connection")
oConnection.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sConfigFile & ";Extended Properties=Excel 8.0;Persist Security Info=False;Jet OLEDB"
Dim oRecordSet, sSQL
Set oRecordSet = CreateObject("ADODB.RecordSet")
sSQL = "Select * from [" & sSheet & "$] where id = '" & sCaseId & "'"
oRecordSet.Open sSQL, oConnection, ADO_FWDONLY
Do Until oRecordSet.EOF
MsgBox oRecordSet("PARENT"))
oRecordSet