Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2004
    Posts
    36

    Unanswered: '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 13:42.

  2. #2
    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 ?

  3. #3
    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

  4. #4
    Join Date
    Feb 2002
    Posts
    2,232
    Post the include file where the objects are created.

  5. #5
    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.

  6. #6
    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.

  7. #7
    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.

  8. #8
    Join Date
    Jan 2004
    Posts
    36
    thanks for the tip...makes perfect sense now that you say that...just never thought of it before

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •