Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
skillile
Posting Yak Master
208 Posts |
Posted - 2002-04-09 : 13:25:38
|
| I have read the Mail Que article and the comments on the error generated when trying to schedule. I am trying to place into DTS as an AX script. Here is my code '******************************************************'this procedure retrieves and sends mail'******************************************************'--------------------'ADO Constants const adCmdStoredProc = &H0004'--------------------'System config const strconn="Provider=SQLOLEDB.1;xxxxcall mainSub main() dim objcmd dim objrs dim mailarr dim x Set objcmd=server.createobject("ADODB.command") With objcmd .activeconnection=strconn .commandtext = "ps_email_send" .commandtype = adcmdstoredproc Set objrs=objcmd.executeEnd with If not objrs.eof then mailarr =objrs.getrows End If Set objrs=nothing Set objcmd=nothing Set strconn=nothing if isarray(mailarr) then For x=0 to ubound(mailarr,2) 'call mail sub call sendmail(mailarr(2,x), mailarr(4,x), mailarr(5,x), mailarr(6,x)) next if isarray(mailarr) then erase mailarr end if end if end subsub sendmail(toemail, fromemail,subject, body)dim myMail'send mailset myMail = createobject("CDONTS.NewMail") myMail.From = fromemail myMail.to=toemail myMail.Subject = subject myMail.BodyFormat=0 myMail.MailFormat=0 myMail.Body = body myMail.sendSet myMail=nothingend subslow down to move faster... |
|
|
AjarnMark
SQL Slashing Gunting Master
3246 Posts |
Posted - 2002-04-09 : 17:18:26
|
| Is there a question in here? Or are you submitting this as your solution to the problem, and it should be stored in the Script Library? What is this?------------------------GENERAL-ly speaking... |
 |
|
|
skillile
Posting Yak Master
208 Posts |
Posted - 2002-04-09 : 21:53:19
|
| Yeah, sorry I was looking at the thread and ran into the same problem as others with the error. The solution was to go convert the proc to DTS with some adjusted code.I was looking for the DTS solution if anyone had it handy.Sorry for the confusion.slow down to move faster... |
 |
|
|
|
|
|
|
|