ADODB.Recordset对象的传递实验
上一篇 /
下一篇 2009-09-08 23:38:29
/ 个人分类:ADO
下面为通过ADO连接的 查询结果记录集的传递调用例子
f1
Function f1()
Dim conn,input,filename
filename="D:\worksfile\软件测试-softtesting\09年初_复习计划.xls" '
Set conn= createobject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source="&filename&";Extended Properties='Excel 8.0;hdr=yes'"
Set input= createobject("ADODB.Recordset")
'Set input2= createobject("ADODB.Recordset")
input.Open "select * from [Sheet2$] " ,conn,2,2
' input2.Open "select * from [Sheet2$] " ,conn,2,2
set input2 = input
f2(input2)
f3(input2)
End Function
Function f2(input2)
print input2.getstring()
End Function
Function f3(input2)
input2.close
Set input2=nothing
End Function
收藏
举报
TAG: