If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > 'Object required' error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-15-04, 12:40
aliaga61 aliaga61 is offline
Registered User
 
Join Date: Jan 2004
Posts: 36
'Object required' error

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

Last edited by aliaga61; 01-15-04 at 12:42.
Reply With Quote
  #2 (permalink)  
Old 01-15-04, 13:08
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
Where are your objects being created ? Did you forget an include file that you use for adoconn or the recordset objects ?
Reply With Quote
  #3 (permalink)  
Old 01-15-04, 13:10
aliaga61 aliaga61 is offline
Registered User
 
Join Date: Jan 2004
Posts: 36
no, i have the include file there...i just forgot to paste it in with the code, sorry.

like i said though...i've set up my connection and everything exactly the same...i just copied code that was already used...and change the query
Reply With Quote
  #4 (permalink)  
Old 01-15-04, 13:18
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
Post the include file where the objects are created.
Reply With Quote
  #5 (permalink)  
Old 01-15-04, 13:20
aliaga61 aliaga61 is offline
Registered User
 
Join Date: Jan 2004
Posts: 36
i figured out my mistake...i shouldn't have been numbering my adoConnWEBtest1,2,3,etc.

thanks for your help though.
Reply With Quote
  #6 (permalink)  
Old 01-15-04, 13:23
gyuan gyuan is offline
Registered User
 
Join Date: Dec 2003
Posts: 454
You have three connection objects which are adoConn, adoConnWEBtest2 and adoConnWEBtest3 in your code. Did you create all of them? I have a question for you. Are these objects used to connect one database or three different database? If it is only for one, it is not good to open three connections of one database. You can use different record sets but one connection to a database is enough. That will have better performance than the one with three connections to a same database.
Reply With Quote
  #7 (permalink)  
Old 01-15-04, 13:27
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
That will do it - don't forget that you can reuse your connection object so normally all you need is one that can be shared by multiple recordset objects.
Reply With Quote
  #8 (permalink)  
Old 01-15-04, 13:28
aliaga61 aliaga61 is offline
Registered User
 
Join Date: Jan 2004
Posts: 36
thanks for the tip...makes perfect sense now that you say that...just never thought of it before
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On