I am trying to run this code that will return the information in an email...i've tried running the queries seperately in query analyzer and sql plus...and they work fine. when i run the page i get an object required error message:
Microsoft VBScript runtime error '800a01a8'
Object required: ''
/test/testbasket.asp, line 85
line 85 is referring to the set adoRS2 = adoConn.Execute(strSQL) line
it can't be a connection issue because that's how i've handled all of my other queries in the past and they worked fine. any help would be appreciated.
'get work orders whose baskets have changed, with a status of assigned and a dash order or 1, within the last two hours
StrSQL = "Select t.tsnumb, t.tsid, wb.wcseqn, wb.wcbask, wb.wcstat, wb.wcdate from tsr t, wobaskdtl wb where t.tsnumb=wb.wcnumb and wb.wcseqn='1' and wb.wcdate >= sysdate - interval '2' hour and wb.wcstat='A' and wb.wcbask like 'R0%' and t.tsid is not null order by t.tsnumb"
Set adoRS = adoConn.Execute(StrSQL)
do until adoRS.EOF
strWONumb = adoRS(0)
strUserID = adoRS(1)
strSequence = adoRS(2)
strBasket = adoRS(3)
strStatus = adoRS(4)
strDate = adoRS(5)
'beginning of email. standard for all users
Dim MyCDONTSMail2
Dim HTML
Set MyCDONTSMail2 = CreateObject("CDONTS.NewMail")
HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">"
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<title>Work Order Status</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body bgcolor=""FFFFFF"">"
HTML = HTML & "<font size =""3"" face=""Arial"">"
HTML = HTML & "test for WO Basket Change.<br><br>"
'get person's info (id,email)
StrSQL = "Select usr.CMEMAL, usr.CMORGA from tblUserInfo usr where usr.USERID ='" & strUserID & "'"
Set adoRSWEBtest2 = adoConnWEBtest2.Execute(StrSQL)
strUserEmail = adoRSWEBtest2(0)
strUserOrg = adorRSWEBtest2(1)
'get cmo info (id,name,email,phone)
strSQL = "Select Distinct substr(ORTCON,1,6), ORORGA from ORGCODE where ORORGA = '" & strUserOrg & "' order by ORORGA"
set adoRS2 = adoConn.Execute(strSQL)
do until adoRS2.EOF
strAcctNo = adoRS2(0) + "%"
strSQL = "Select Distinct cmo.CMOID, cmo.CMOROLE, cmo.ACCTNO, usr.USERID, usr.CMFNAM, usr.CMMNAM, usr.CMLNAM, usr.CMEMAL, usr.CMPHON, usr.CMEXTN, usr.CMPREFIX from tblCMOList cmo, tblUserInfo usr where cmo.CMOID=usr.USERID and cmo.ACCTNO= '" & strAcctNo & "' order by cmo.CMOROLE desc"
set adoRSWEBtest3 = adoConnWEBtest3.Execute(strSQL)
Do While Not adoRSWEBtest3.EOF
strRole = adoRSWEBtest3(1)
strFullName = adoRSWEBtest3(4) + " " + adoRSWEBtest3(5) + " " + adoRSWEBtest3(6)
strEmail = adoRSWEBtest3(7)
strExt = adoRSWEBtest3(9)
strTele = adoRSWEBtest3(8)
strPrefix = adoRSWEBtest3(10)
'format telephone number to include "()" and "-"
if Len(strTele) = 10 then
strFormatted = "(" & mid(strTele,1,3) & ") " & mid(strTele,4,3) & "-" & mid(strTele,7,4)
else
'if not a 10 digit number, don't format the number
strFormatted = strTele
end if
'display cmos' information
HTML = HTML & "" & strPrefix & " " & strFullName & " (" & strRole & ") <br>"
HTML = HTML & "" & strEmail & "<br>"
HTML = HTML & "" & strFormatted & "<br><br>"
'place cmos' email addresses into one string for "to" field of email
strListing = trim(strEmail) & "; " & strListing
adoRSWEBtest3.MoveNext
Loop
adoRS2.MoveNext
loop
HTML = HTML & "<br><br>"
HTML = HTML & ""& strCurrentTime &" "
HTML = HTML & " "& adoRS(0) &" "
HTML = HTML & " "& adoRS(2) &" "
HTML = HTML & " "& adoRS(1) &" "
HTML = HTML & " "& adoRS(3) &" "
HTML = HTML & " "& adoRS(4) &" "
HTML = HTML & " "& adoRS(5) &"<br>"
HTML = HTML & "<br>"
'closing of email. Standard for all users with the exception of the "to" field
HTML = HTML & "Thank You,<br>"
HTML = HTML & "DMATS<br>"
HTML = HTML & "CMOs Email" & strListing & "<br>"
HTML = HTML & "User's Email" & strUserEmail & "<br>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"
MyCDONTSMail2.From= "aliaga61@earthlink.net"
MyCDONTSMail2.To="aliaga61@earthlink.net"
MyCDONTSMail2.Subject="WO Basket Change"
MyCDONTSMail2.BodyFormat=0
MyCDONTSMail2.MailFormat=0
MyCDONTSMail2.Body=HTML
MyCDONTSMail2.Send
set MyCDONTSMail2=nothing
adoRS.MoveNext
loop