Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 1st, 2003, 11:26 PM
purple purple is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 6 purple User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question object required 800A01A8

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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > object required 800A01A8


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT