Set fs= createObject("Scripting.FileSystemObject") Set sqlObj= createobject ("ADODB.connection")
Set filetext=fs.OpenTextFile("D:\testfile.txt",1,forreading) readfile=a.ReadAll '读取文件内容 filetext.Close Set fs=nothing strConn="Driver={microsoft odbc for oracle}; server=**** ;uid=**;pwd=**" '此处引用oracle数据源
sqlObj.Open strConn Set amd=createobject("adodb.command") amd.ActiveConnection=strConn '获取command对象使用的connection对象的引用 amd.CommandText =readfile amd.CommandType=1 'commandtype 是1为sql查询 4为存储过程 Set result=amd.Execute() If result.State=1 Then '如果执行完毕msgbox ok msgbox "ok"