472,328 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,328 software developers and data experts.

Somebody Please Help Me Convert this ASP to VBS

Hi Gang

I'm not sure what needs to be changed when converting an asp to vbs.
I'm not sure if I can with my code below. Can someone PLEASE convert
the text below to vbs?

Thanks a million.
Andy
<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->

<%
' Create a connection to the Notification database and open it.
Set NotificationDatabaseConn = Server.CreateObject("ADODB.Connection")
NotificationDatabaseConn.Open "Data Source=" &
Server.Mappath("../cadim/data/notifications.mdb") &
";Provider=Microsoft.Jet.OLEDB.4.0;"

lcSQL = "SELECT CADIMUser, CADIMUserPassword, SMTPServer, eMailAdmin
FROM SystemConfig"
Set RSSystemDefaults = NotificationDatabaseConn.Execute(lcSQL)

lcCADIMUser = RSSystemDefaults ("CADIMUser")
lcCADIMUserPassword = RSSystemDefaults ("CADIMUserPassword")
lcSMTPServer = RSSystemDefaults ("SMTPServer")
lceMailAdmin = RSSystemDefaults ("eMailAdmin")

' Create a connection to the CADIM database and open it.
Set CADIMDatabaseConn = Server.CreateObject("ADODB.Connection")
CADIMDatabaseConn.Open "dsn=CADIMProductionDB;uid=" & lcCADIMUser &
";pwd=" & lcCADIMUserPassword & ";"

' Delete all the previous notifications
lcSQL = "DELETE * FROM Notifications"
Set RSDeleteNotifications = NotificationDatabaseConn.Execute(lcSQL)
' Create a simple SQL Select statement for testing.
lcSQL = "SELECT C_ID, ELEM_ID, S010000_AEND_ART_ENG FROM
PLMAD_PROD.T_EWO_DAT WHERE S010000_ORG_EINH='013060' AND (LEV_IND =
'605' OR LEV_IND = '610') AND S010000_AEND_ART_ENG <> 'Normal change A
doc'"

Set RSECOList = CADIMDatabaseConn.Execute(lcSQL)

Do While Not RSECOList.EOF
lcECOType = RSECOList("S010000_AEND_ART_ENG")
lcECOID = RSECOList("C_ID")
lcECONum = RSECOList("ELEM_ID")

lcSQL = "SELECT BEARB_PRS_ID, FUNKTION, BEREICH, MAIL_AUSG, OK_KZ
FROM PLMAD_PROD.T_S010000EWOM WHERE C_ID_1 = '" & lcECOID & "' AND
OK_KZ = '_'"
Set RSECODetails = CADIMDatabaseConn.Execute(lcSQL)

lcApplicantSentRequestForApproval = "False"
Do While Not RSECODetails.EOF
If Not IsNull(RSECODetails("MAIL_AUSG")) Or
Len(RSECODetails("MAIL_AUSG")) <> 0 Then
lcApplicantSentRequestForApproval = "True"
End If
RSECODetails.MoveNext
Loop
' Loop through the details again now we know someone has been
' notified once to approve the change and build the notification
table

If lcApplicantSentRequestForApproval = "True" Then
RSECODetails.MoveFirst
Do While Not RSECODetails.EOF

lcDeptFunction = RSECODetails("BEREICH")
lcJobRole = RSECODetails("FUNKTION")

If lcJobRole <> "Applicant" Then

lcSQL = "SELECT COUNT(ecotype) AS ecocount FROM
notificationconfig " & _
"WHERE ecotype = '" & lcECOType & "' AND jobrole =
'" & lcJobRole & "' AND deptfunction = '" & lcDeptFunction & "'"
Set RSECOCount =
NotificationDatabaseConn.Execute(lcSQL)

If RSECOCount("ecocount") > 0 Then

lcSQL = "SELECT sequence, changestage, ecotype FROM
notificationconfig " & _
"WHERE ecotype = '" & lcECOType & "' AND jobrole =
'" & lcJobRole & "' AND deptfunction = '" & lcDeptFunction & "'"
Set RSECOConfigDetails =
NotificationDatabaseConn.Execute(lcSQL)

lcSequence = RSECOConfigDetails("sequence")
lcChangeStage = RSECOConfigDetails("changestage")
lcECOType = RSECOConfigDetails("ecotype")

lcECOPersonId = RSECODetails("BEARB_PRS_ID")
lcSQL = "SELECT S_USER, S_FIRST_NAME, S_EMAIL FROM
PLMAD_PROD.T_PRS_DAT WHERE EDB_ID = '" & lcECOPersonId & "'"
Set RSPersonDetails = CADIMDatabaseConn.Execute(lcSQL)

lcFirstName = RSPersonDetails("S_FIRST_NAME")
lcLastName = RSPersonDetails("S_USER")
lceMailAddress = RSPersonDetails("S_EMAIL")
'Insert the new notification into the notification
table

lcSQL = "INSERT INTO notifications " &_
"(econum, changestage, sequence, firstname, lastname,
emailaddress, jobrole, deptfunction, ecotype) " &_
"VALUES ('" & lcECONum & "', '" & lcChangeStage & "', " &
lcSequence & ", '" & lcFirstName & "', '" & lcLastName & "', '" &
lceMailAddress & "', '" & lcJobRole & "', '" & lcDeptFunction & "', '"
& lcECOType & "')"
Set RSInsert = NotificationDatabaseConn.Execute(lcSQL)

Else

' There was a dept function and/or job role that was not
recognized by
' the notificationconfig table.

lcBodyError = "<html><head><meta http-equiv='Content-Language'
content='en-us'><meta http-equiv='Content-Type' content='text/html;
charset=windows-1252'><title>CADIM EC Action
Requirements</title></head><body><font face='Arial' style='FONT-SIZE:
9pt'>"
lcBodyError = lcBodyError & "The following signature is not a
default signature. The user will not be sent a notification and this
needs to be corrected.<br><br>"
lcBodyError = lcBodyError & "<b>ECO Number: </b>" & lcECONum &
"<br>"
lcBodyError = lcBodyError & "<b>Department Function: </b>" &
lcDeptFunction & "<br>"
lcBodyError = lcBodyError & "<b>Job Role: </b>" & lcJobRole &
"<br>"
lcBodyError = lcBodyError & "</font></body></html>"

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = lceMailAdmin
.To = "an**@mycompany.com"
.Subject = "CADIM Comm List Member Can't Be Notified"
.HTMLBody = lcBodyError
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing

End If

End If

RSECODetails.MoveNext
Loop
End If

RSECOList.MoveNext
Loop
' Setup the send status for each notification. We only want to send
' an email to a user once with all the action.

lcSQL = "SELECT * FROM notifications ORDER BY econum, sequence"
Set RSNotifications = NotificationDatabaseConn.Execute(lcSQL)

lcOldSequence = ""
lcOldECONum = ""

Do While Not RSNotifications.EOF
lcBodyTableRecs = ""
lcECONum = ""
lcChangeStage = ""
lcECOType = ""
lcAction = ""

If lcOldECONum <> RSNotifications("econum") Then
lcOldSequence = RSNotifications("sequence")
End If

If lcOldSequence = RSNotifications("sequence") Then
lcECONum = RSNotifications("econum")
lcChangeStage = RSNotifications("changestage")
lcECOType = RSNotifications("ecotype")
lcJobRole = RSNotifications("jobrole")
lcDeptFunction = RSNotifications("deptfunction")
lcSequence = RSNotifications("sequence")
lcFirstName = RSNotifications("firstname")
lcLastName = RSNotifications("lastname")
lceMailAddress = RSNotifications("emailaddress")

lcSQL = "UPDATE notifications SET sendstatus = 'Y' " &_
"WHERE econum = '" & lcECONum & "' And " & _
"changestage = '" & lcChangeStage & "' And " & _
"sequence = " & lcSequence & " And " & _
"jobrole = '" & lcJobRole & "' And " & _
"deptfunction = '" & lcDeptFunction & "' And " & _
"firstname = '" & lcFirstName & "' And " & _
"lastname = '" & lcLastName & "' And " & _
"emailaddress = '" & lceMailAddress & "'"

Set RSUpdate = NotificationDatabaseConn.Execute(lcSQL)
End If

lcOldECONum = RSNotifications("econum")
' lcOldSequence = RSNotifications("sequence")
RSNotifications.MoveNext
Loop

'Send out the notifications.

lcSQL = "SELECT header, body, bodytable, footer FROM eMailConfig"
Set RSeMailDefaults = NotificationDatabaseConn.Execute(lcSQL)

lcHeader = RSeMailDefaults("header")
lcBody = RSeMailDefaults("body")
lcBodyTable = RSeMailDefaults("bodytable")
lcFooter = RSeMailDefaults("footer")
lcSQL = "SELECT * FROM notifications WHERE sendstatus = 'Y' ORDER BY
emailaddress, sequence DESC"
Set RSNotifications = NotificationDatabaseConn.Execute(lcSQL)
lcOldeMail = ""
lceMailBody = ""
lcBodyTableRecs = ""
lcFirst = "True"

Do While Not RSNotifications.EOF

If lcOldeMail <> RSNotifications("emailaddress") And lcFirst <> "True"
Then

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = lceMailAdmin
.To = "an**@mycompany.com"
.Cc = "an**@mycompany.com"
.Subject = lceMailSubject
.HTMLBody = lceMailBody
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing

lceMailBody = ""
lcBodyTableRecs = ""
lceMailSubject = ""

End If

lcFirst = "False"
lceMailSubject = "Required CADIM EC Actions For " &
RSNotifications("firstname") & " " & RSNotifications("lastname")
lcECONum = RSNotifications("econum")
lcChangeStage = RSNotifications("changestage")
lcECOType = RSNotifications("ecotype")
lcAction = "Review as the " & RSNotifications("jobrole") & " - " &
RSNotifications("deptfunction") & " representative."

lcBodyTableRecs = lcBodyTableRecs & "<tr>"
lcBodyTableRecs = lcBodyTableRecs & "<td><font face='Arial'
style='FONT-SIZE: 9pt'>" & lcECONum & "</font></td>"
lcBodyTableRecs = lcBodyTableRecs & "<td><font face='Arial'
style='FONT-SIZE: 9pt'>" & lcAction & "</font></td>"
lcBodyTableRecs = lcBodyTableRecs & "<td><font face='Arial'
style='FONT-SIZE: 9pt'>" & lcECOType & "</font></td>"
lcBodyTableRecs = lcBodyTableRecs & "<td><font face='Arial'
style='FONT-SIZE: 9pt'>" & lcChangeStage & "</font></td>"
lcBodyTableRecs = lcBodyTableRecs & "</tr>"

lceMailBody = lcHeader
lceMailBody = lceMailBody & RSNotifications("firstname")
lceMailBody = lceMailBody & lcBody
lceMailBody = lceMailBody & lcBodyTable
lceMailBody = lceMailBody & lcBodyTableRecs
lceMailBody = lceMailBody & lcFooter
lcOldeMail = RSNotifications("emailaddress")
RSNotifications.MoveNext
Loop
'Get the last user to send the email to

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = lceMailAdmin
.To = "an**@mycompany.com"
.Cc = "an**@mycompany.com"
.Subject = lceMailSubject
.HTMLBody = lceMailBody
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
' Close the connection to the databases
CADIMDatabaseConn.Close
NotificationDatabaseConn.Close
%>

Jun 29 '06 #1
4 3816
wrote on 29 jun 2006 in microsoft.public.inetserver.asp.general:
I'm not sure what needs to be changed when converting an asp to vbs.


ASP is a platform for writing serverside code in VBS or Jscript [or ...].

VBS is a scripting language.

You cannot convert a platform INTO one of it's supported languages.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jun 29 '06 #2
On 29 Jun 2006 21:22:41 GMT, "Evertjan." <ex**************@interxnl.net>
wrote:
in <Xn********************@194.109.133.242>
wrote on 29 jun 2006 in microsoft.public.inetserver.asp.general:
I'm not sure what needs to be changed when converting an asp to vbs.


ASP is a platform for writing serverside code in VBS or Jscript [or ...].

VBS is a scripting language.

You cannot convert a platform INTO one of it's supported languages.


Isn't ASP also an acronym for active server page? Then you'd have to
take it's meaning from context and in this case the OP was obviously
referring to an asp page. Ah, the Department of Redundancy Department.

---
Stefan Berglund
Jun 29 '06 #3
That's a pretty narrow-minded answer -- you must be taking lessons from
Celko? Of course, Andy is asking about converting an ASP page (not the
platform, duh) to a VBS script. Which is a pretty common task, in fact one
I have performed many times.

ASP is a platform for writing serverside code in VBS or Jscript [or ...].

VBS is a scripting language.

You cannot convert a platform INTO one of it's supported languages.

Jun 30 '06 #4
Andy, the most complicated part is getting all of your constants from the
CDO library defined in the VBS script, since you cannot use that metadata
tag in VBS as far as I know. So far the only constant I see in use is
cdoSendUsingPort, and you can simply change these to a hard-coded value of
2, or at the beginning of the VBS script, place this line:

const cdoSendUsingPort = 2

The most common pitfalls when switching over:
- forgetting to change response.write to either msgbox or
logfile.writeline
- forgetting to take out any HTML, css or client-side script output
And forgetting that you're no longer in the context of a "server":
- changing references such as server.createobject to createobject
- removing things like server.transfer / response.redirect - you're no
longer in a browser
- similarly with server.mappath, this no longer makes sense

Basically, most of your code looks fine, except changing things like
Server.CreateObject("ADODB.Connection") to CreateObject("ADODB.Connection")
and changing Server.MapPath("../cadim/data/notifications.mdb") to a local
path (e.g. c:\inetpub\wwwroot\cadim\data\notifications.mdb).


<an***********@siemens.com> wrote in message
news:11**********************@d56g2000cwd.googlegr oups.com...
Hi Gang

I'm not sure what needs to be changed when converting an asp to vbs.
I'm not sure if I can with my code below. Can someone PLEASE convert
the text below to vbs?

Thanks a million.
Andy
<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->

<%
' Create a connection to the Notification database and open it.
Set NotificationDatabaseConn = Server.CreateObject("ADODB.Connection")
NotificationDatabaseConn.Open "Data Source=" &
Server.Mappath("../cadim/data/notifications.mdb") &
";Provider=Microsoft.Jet.OLEDB.4.0;"

lcSQL = "SELECT CADIMUser, CADIMUserPassword, SMTPServer, eMailAdmin
FROM SystemConfig"
Set RSSystemDefaults = NotificationDatabaseConn.Execute(lcSQL)

lcCADIMUser = RSSystemDefaults ("CADIMUser")
lcCADIMUserPassword = RSSystemDefaults ("CADIMUserPassword")
lcSMTPServer = RSSystemDefaults ("SMTPServer")
lceMailAdmin = RSSystemDefaults ("eMailAdmin")

' Create a connection to the CADIM database and open it.
Set CADIMDatabaseConn = Server.CreateObject("ADODB.Connection")
CADIMDatabaseConn.Open "dsn=CADIMProductionDB;uid=" & lcCADIMUser &
";pwd=" & lcCADIMUserPassword & ";"

' Delete all the previous notifications
lcSQL = "DELETE * FROM Notifications"
Set RSDeleteNotifications = NotificationDatabaseConn.Execute(lcSQL)
' Create a simple SQL Select statement for testing.
lcSQL = "SELECT C_ID, ELEM_ID, S010000_AEND_ART_ENG FROM
PLMAD_PROD.T_EWO_DAT WHERE S010000_ORG_EINH='013060' AND (LEV_IND =
'605' OR LEV_IND = '610') AND S010000_AEND_ART_ENG <> 'Normal change A
doc'"

Set RSECOList = CADIMDatabaseConn.Execute(lcSQL)

Do While Not RSECOList.EOF
lcECOType = RSECOList("S010000_AEND_ART_ENG")
lcECOID = RSECOList("C_ID")
lcECONum = RSECOList("ELEM_ID")

lcSQL = "SELECT BEARB_PRS_ID, FUNKTION, BEREICH, MAIL_AUSG, OK_KZ
FROM PLMAD_PROD.T_S010000EWOM WHERE C_ID_1 = '" & lcECOID & "' AND
OK_KZ = '_'"
Set RSECODetails = CADIMDatabaseConn.Execute(lcSQL)

lcApplicantSentRequestForApproval = "False"
Do While Not RSECODetails.EOF
If Not IsNull(RSECODetails("MAIL_AUSG")) Or
Len(RSECODetails("MAIL_AUSG")) <> 0 Then
lcApplicantSentRequestForApproval = "True"
End If
RSECODetails.MoveNext
Loop
' Loop through the details again now we know someone has been
' notified once to approve the change and build the notification
table

If lcApplicantSentRequestForApproval = "True" Then
RSECODetails.MoveFirst
Do While Not RSECODetails.EOF

lcDeptFunction = RSECODetails("BEREICH")
lcJobRole = RSECODetails("FUNKTION")

If lcJobRole <> "Applicant" Then

lcSQL = "SELECT COUNT(ecotype) AS ecocount FROM
notificationconfig " & _
"WHERE ecotype = '" & lcECOType & "' AND jobrole =
'" & lcJobRole & "' AND deptfunction = '" & lcDeptFunction & "'"
Set RSECOCount =
NotificationDatabaseConn.Execute(lcSQL)

If RSECOCount("ecocount") > 0 Then

lcSQL = "SELECT sequence, changestage, ecotype FROM
notificationconfig " & _
"WHERE ecotype = '" & lcECOType & "' AND jobrole =
'" & lcJobRole & "' AND deptfunction = '" & lcDeptFunction & "'"
Set RSECOConfigDetails =
NotificationDatabaseConn.Execute(lcSQL)

lcSequence = RSECOConfigDetails("sequence")
lcChangeStage = RSECOConfigDetails("changestage")
lcECOType = RSECOConfigDetails("ecotype")

lcECOPersonId = RSECODetails("BEARB_PRS_ID")
lcSQL = "SELECT S_USER, S_FIRST_NAME, S_EMAIL FROM
PLMAD_PROD.T_PRS_DAT WHERE EDB_ID = '" & lcECOPersonId & "'"
Set RSPersonDetails = CADIMDatabaseConn.Execute(lcSQL)

lcFirstName = RSPersonDetails("S_FIRST_NAME")
lcLastName = RSPersonDetails("S_USER")
lceMailAddress = RSPersonDetails("S_EMAIL")
'Insert the new notification into the notification
table

lcSQL = "INSERT INTO notifications " &_
"(econum, changestage, sequence, firstname, lastname,
emailaddress, jobrole, deptfunction, ecotype) " &_
"VALUES ('" & lcECONum & "', '" & lcChangeStage & "', " &
lcSequence & ", '" & lcFirstName & "', '" & lcLastName & "', '" &
lceMailAddress & "', '" & lcJobRole & "', '" & lcDeptFunction & "', '"
& lcECOType & "')"
Set RSInsert = NotificationDatabaseConn.Execute(lcSQL)

Else

' There was a dept function and/or job role that was not
recognized by
' the notificationconfig table.

lcBodyError = "<html><head><meta http-equiv='Content-Language'
content='en-us'><meta http-equiv='Content-Type' content='text/html;
charset=windows-1252'><title>CADIM EC Action
Requirements</title></head><body><font face='Arial' style='FONT-SIZE:
9pt'>"
lcBodyError = lcBodyError & "The following signature is not a
default signature. The user will not be sent a notification and this
needs to be corrected.<br><br>"
lcBodyError = lcBodyError & "<b>ECO Number: </b>" & lcECONum &
"<br>"
lcBodyError = lcBodyError & "<b>Department Function: </b>" &
lcDeptFunction & "<br>"
lcBodyError = lcBodyError & "<b>Job Role: </b>" & lcJobRole &
"<br>"
lcBodyError = lcBodyError & "</font></body></html>"

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = lceMailAdmin
.To = "an**@mycompany.com"
.Subject = "CADIM Comm List Member Can't Be Notified"
.HTMLBody = lcBodyError
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing

End If

End If

RSECODetails.MoveNext
Loop
End If

RSECOList.MoveNext
Loop
' Setup the send status for each notification. We only want to send
' an email to a user once with all the action.

lcSQL = "SELECT * FROM notifications ORDER BY econum, sequence"
Set RSNotifications = NotificationDatabaseConn.Execute(lcSQL)

lcOldSequence = ""
lcOldECONum = ""

Do While Not RSNotifications.EOF
lcBodyTableRecs = ""
lcECONum = ""
lcChangeStage = ""
lcECOType = ""
lcAction = ""

If lcOldECONum <> RSNotifications("econum") Then
lcOldSequence = RSNotifications("sequence")
End If

If lcOldSequence = RSNotifications("sequence") Then
lcECONum = RSNotifications("econum")
lcChangeStage = RSNotifications("changestage")
lcECOType = RSNotifications("ecotype")
lcJobRole = RSNotifications("jobrole")
lcDeptFunction = RSNotifications("deptfunction")
lcSequence = RSNotifications("sequence")
lcFirstName = RSNotifications("firstname")
lcLastName = RSNotifications("lastname")
lceMailAddress = RSNotifications("emailaddress")

lcSQL = "UPDATE notifications SET sendstatus = 'Y' " &_
"WHERE econum = '" & lcECONum & "' And " & _
"changestage = '" & lcChangeStage & "' And " & _
"sequence = " & lcSequence & " And " & _
"jobrole = '" & lcJobRole & "' And " & _
"deptfunction = '" & lcDeptFunction & "' And " & _
"firstname = '" & lcFirstName & "' And " & _
"lastname = '" & lcLastName & "' And " & _
"emailaddress = '" & lceMailAddress & "'"

Set RSUpdate = NotificationDatabaseConn.Execute(lcSQL)
End If

lcOldECONum = RSNotifications("econum")
' lcOldSequence = RSNotifications("sequence")
RSNotifications.MoveNext
Loop

'Send out the notifications.

lcSQL = "SELECT header, body, bodytable, footer FROM eMailConfig"
Set RSeMailDefaults = NotificationDatabaseConn.Execute(lcSQL)

lcHeader = RSeMailDefaults("header")
lcBody = RSeMailDefaults("body")
lcBodyTable = RSeMailDefaults("bodytable")
lcFooter = RSeMailDefaults("footer")
lcSQL = "SELECT * FROM notifications WHERE sendstatus = 'Y' ORDER BY
emailaddress, sequence DESC"
Set RSNotifications = NotificationDatabaseConn.Execute(lcSQL)
lcOldeMail = ""
lceMailBody = ""
lcBodyTableRecs = ""
lcFirst = "True"

Do While Not RSNotifications.EOF

If lcOldeMail <> RSNotifications("emailaddress") And lcFirst <> "True"
Then

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = lceMailAdmin
.To = "an**@mycompany.com"
.Cc = "an**@mycompany.com"
.Subject = lceMailSubject
.HTMLBody = lceMailBody
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing

lceMailBody = ""
lcBodyTableRecs = ""
lceMailSubject = ""

End If

lcFirst = "False"
lceMailSubject = "Required CADIM EC Actions For " &
RSNotifications("firstname") & " " & RSNotifications("lastname")
lcECONum = RSNotifications("econum")
lcChangeStage = RSNotifications("changestage")
lcECOType = RSNotifications("ecotype")
lcAction = "Review as the " & RSNotifications("jobrole") & " - " &
RSNotifications("deptfunction") & " representative."

lcBodyTableRecs = lcBodyTableRecs & "<tr>"
lcBodyTableRecs = lcBodyTableRecs & "<td><font face='Arial'
style='FONT-SIZE: 9pt'>" & lcECONum & "</font></td>"
lcBodyTableRecs = lcBodyTableRecs & "<td><font face='Arial'
style='FONT-SIZE: 9pt'>" & lcAction & "</font></td>"
lcBodyTableRecs = lcBodyTableRecs & "<td><font face='Arial'
style='FONT-SIZE: 9pt'>" & lcECOType & "</font></td>"
lcBodyTableRecs = lcBodyTableRecs & "<td><font face='Arial'
style='FONT-SIZE: 9pt'>" & lcChangeStage & "</font></td>"
lcBodyTableRecs = lcBodyTableRecs & "</tr>"

lceMailBody = lcHeader
lceMailBody = lceMailBody & RSNotifications("firstname")
lceMailBody = lceMailBody & lcBody
lceMailBody = lceMailBody & lcBodyTable
lceMailBody = lceMailBody & lcBodyTableRecs
lceMailBody = lceMailBody & lcFooter
lcOldeMail = RSNotifications("emailaddress")
RSNotifications.MoveNext
Loop
'Get the last user to send the email to

Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = lceMailAdmin
.To = "an**@mycompany.com"
.Cc = "an**@mycompany.com"
.Subject = lceMailSubject
.HTMLBody = lceMailBody
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing
' Close the connection to the databases
CADIMDatabaseConn.Close
NotificationDatabaseConn.Close
%>

Jun 30 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: martijn | last post by:
Hi There, my vb app can open files. Well, actually my vb app launches word or excell to open them. These files are shared in a network. If...
2
by: mario | last post by:
Hi, I have verry big problem. I must write function using dates. This is a problem: I have some dates for example: 2006-01-01, 2006-02-05,...
0
by: Jai | last post by:
Hi, Somebody please tell me how to bind(two way) a checkboxlist with objectdatasource if the checkboxlist is inside a formview..... Code of...
14
by: bbawa1 | last post by:
It says invalid expression term && protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if...
0
by: rahul gupta | last post by:
hi all i got stucked in 1 problem.i am getting err (java.text.ParseException: Unparseable date: "2007-06-29 11:34:59.0") on this line--utilDate =...
14
by: cool.vimalsmail | last post by:
i dont know how to convert a txt file into a zip file (i.e.,)i have a file named packages and i want the packages file with a ".gz" extension by...
5
by: Sunfire | last post by:
Can somebody put this code into c#? Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim imageFolder...
4
by: jg007 | last post by:
Hi, I have some code that somebody has vritten in C and although I have got it to roughly work it is hard going and I can't get it to do exactly...
9
by: ahilar12 | last post by:
1. <head> 2. <script type="text/javascript"> 3. </script> 4. </head> 5. <body> 6. <form> 7. <select name="team" id="mylist"...
0
by: tammygombez | last post by:
Hey fellow JavaFX developers, I'm currently working on a project that involves using a ComboBox in JavaFX, and I've run into a bit of an issue....
0
by: tammygombez | last post by:
Hey everyone! I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
1
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.