下面代码运行后,读数据正确,但wscript.exe错误,以前好像遇到过,是连接参数的问题
--------------------------------------
'数据库连接
Dim Res
'Dim Cmd
Dim StrCon
set conn=createobject("adodb.connection")
Set Res = CreateObject("ADODB.Recordset")
'Set Cmd = CreateObject("ADODB.Command")
StrCon ="DRIVER={Oracle in
OraClient10g_home1};SERVER=huangjmOra;UID=lars01;PWD=lars01;DBQ=ossdb;DBA=W;APA=T;EXC=F;XSM=Default;FEN=T;QTO=T;
FRC=10;FDL=10;LOB=T;RST=T;GDE=F;FRL=Lo;BAM=IfAllSuccessful;MTS=F;MDI=Me;CSR=F;FWC=F;PFC=6000;TLO=O;"
conn.open StrCon
'Cmd.activeconnection=StrCon
'Cmd.CommandType =1
if 0 = conn.state then
msgbox "数据库连接失败"
end if
'-----------------------------------------------------------------
'执行SQL语句
Strsql="SELECT serviceid,mouduleid,portalid,actionid,inserttime FROM OP_MAIL_DETAIL_01_1008 WHERE
username='13590142075'"
'Cmd.CommandText=StrSql
''Set Res = Cmd.Execute()
Res.open Strsql,conn,3,3
'msgbox Res.Fields(0)
'msgbox Res.Fields(1)
'msgbox Res.Fields(2)
'msgbox Res.Fields(3)
msgbox Res.Fields(4)
'---------------------------------------------------------
'关闭数据库
conn.close
set conn=nothing
'Set Res=nothing
'Set Cmd=nothing