|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I am writing a vbscript
(.vbs) and run it in w2k server. but it also check the database and run only one record, (total 4 record) and stop with the above error appear. Mail did send out but only 1 instead of 4. my code as below: Dim cnConn,sqlbirthdate, rsbirthdate,objsendmail,MRGMSGBODY Set cnConn=CreateObject("ADODB.Connection") set rsbirthdate=createobject("ADODB.Recordset") cnConn.open("DRIVER={Oracle73 Ver 2.5};DSN=sr01;DBQ=sr01;UID=miswww;PWD=maverick;") set rsbirthdate = cnconn.execute("select email from test") 'Create a new message set objsendmail = createobject("cdonts.newmail") while not rsbirthdate.eof objsendmail.to ="may.lee@sunright.com" objsendmail.from = rsbirthdate("email") objsendmail.importance = 2 objsendmail.bodyformat = 0 objsendmail.mailformat = 0 objsendmail.subject="Happy Birthday" MRGMSGBODY = "<HTML>" MRGMSGBODY= MRGMSGBODY + "<HEAD>" MRGMSGBODY= MRGMSGBODY + "</HEAD><body>" MRGMSGBODY= MRGMSGBODY + "<H5>To: " & rsbirthdate("email") & "</h5>" MRGMSGBODY= MRGMSGBODY + "<H5>From the management of KES Systems</h5></br></br>" MRGMSGBODY= MRGMSGBODY + "<H5>* Pls proceed to the HR office for your birthday voucher</h5></br>" MRGMSGBODY= MRGMSGBODY + "</Body>" MRGMSGBODY= MRGMSGBODY + "</HTML>" objsendmail.body = MRGMSGBODY objsendmail.send set objsendmail=nothing rsbirthdate.movenext wend Appreicate if someone can tell me why I went wrong. Thks |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > object required 800A01A8 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|