为什么vbscript的第二个ado.connection不能连接,第一个却能连?

来源:百度知道 编辑:UC知道 时间:2024/06/21 14:16:40
'创建存储文本
Dim con_excel0,con_excel1,con_excel2,con_rs,sqlw,txtfile,fso
Const forreading=1,forwriting=2,forappending=8
Set fso=CreateObject("scripting.filesystemobject")
Set txtfile=fso.opentextfile("d:\boss\text.txt",forappending)
'建立连接
Set con_excel0=CreateObject("adodb.connection")
con_excel0.open "provider=microsoft.jet.OLEDB.4.0;Persist Security Info=False;Data Source=d:\boss\test0.xls;Extended Properties='Excel 8.0;HDR=Yes'"

Set con_excel1=CreateObject("adodb.connection")
con_excel1.open "provider=microsoft.jet.OLEDB.4.0;Persist Security Info=False;Data Source=d:\boss\test1.xls;Extended Properties='Excel 8.0;HDR=Yes'"

Set con_excel1=CreateObject("adodb.connection")
con_excel1.open "provider=microsoft.jet.OLEDB.4.0;Persist Security Info=False;Data Source=d:\boss\test2.xls;Extended Properti

Set con_excel1=CreateObject("adodb.connection")
con_excel1.open "provider=microsoft.jet.OLEDB.4.0;Persist Security Info=False;Data Source=d:\boss\test1.xls;Extended Properties='Excel 8.0;HDR=Yes'"

这里 Set con_excel1 = Nothing

Set con_excel1=CreateObject("adodb.connection")
con_excel1.open "provider=microsoft.jet.OLEDB.4.0;Persist Security Info=False;Data Source=d:\boss\test2.xls;Extended Properties='Excel 8.0;HDR=Yes'"