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:

 

评分:0

我来说两句

我的栏目

日历

« 2024-05-13  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 3462
  • 日志数: 6
  • 图片数: 1
  • 建立时间: 2009-08-31
  • 更新时间: 2011-04-19

RSS订阅

Open Toolbar