473,698 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 NotificationDat abaseConn = Server.CreateOb ject("ADODB.Con nection")
NotificationDat abaseConn.Open "Data Source=" &
Server.Mappath( "../cadim/data/notifications.m db") &
";Provider=Micr osoft.Jet.OLEDB .4.0;"

lcSQL = "SELECT CADIMUser, CADIMUserPasswo rd, SMTPServer, eMailAdmin
FROM SystemConfig"
Set RSSystemDefault s = NotificationDat abaseConn.Execu te(lcSQL)

lcCADIMUser = RSSystemDefault s ("CADIMUser" )
lcCADIMUserPass word = RSSystemDefault s ("CADIMUserPass word")
lcSMTPServer = RSSystemDefault s ("SMTPServer ")
lceMailAdmin = RSSystemDefault s ("eMailAdmin ")

' Create a connection to the CADIM database and open it.
Set CADIMDatabaseCo nn = Server.CreateOb ject("ADODB.Con nection")
CADIMDatabaseCo nn.Open "dsn=CADIMProdu ctionDB;uid=" & lcCADIMUser &
";pwd=" & lcCADIMUserPass word & ";"

' Delete all the previous notifications
lcSQL = "DELETE * FROM Notifications"
Set RSDeleteNotific ations = NotificationDat abaseConn.Execu te(lcSQL)
' Create a simple SQL Select statement for testing.
lcSQL = "SELECT C_ID, ELEM_ID, S010000_AEND_AR T_ENG FROM
PLMAD_PROD.T_EW O_DAT WHERE S010000_ORG_EIN H='013060' AND (LEV_IND =
'605' OR LEV_IND = '610') AND S010000_AEND_AR T_ENG <> 'Normal change A
doc'"

Set RSECOList = CADIMDatabaseCo nn.Execute(lcSQ L)

Do While Not RSECOList.EOF
lcECOType = RSECOList("S010 000_AEND_ART_EN G")
lcECOID = RSECOList("C_ID ")
lcECONum = RSECOList("ELEM _ID")

lcSQL = "SELECT BEARB_PRS_ID, FUNKTION, BEREICH, MAIL_AUSG, OK_KZ
FROM PLMAD_PROD.T_S0 10000EWOM WHERE C_ID_1 = '" & lcECOID & "' AND
OK_KZ = '_'"
Set RSECODetails = CADIMDatabaseCo nn.Execute(lcSQ L)

lcApplicantSent RequestForAppro val = "False"
Do While Not RSECODetails.EO F
If Not IsNull(RSECODet ails("MAIL_AUSG ")) Or
Len(RSECODetail s("MAIL_AUSG" )) <> 0 Then
lcApplicantSent RequestForAppro val = "True"
End If
RSECODetails.Mo veNext
Loop
' Loop through the details again now we know someone has been
' notified once to approve the change and build the notification
table

If lcApplicantSent RequestForAppro val = "True" Then
RSECODetails.Mo veFirst
Do While Not RSECODetails.EO F

lcDeptFunction = RSECODetails("B EREICH")
lcJobRole = RSECODetails("F UNKTION")

If lcJobRole <> "Applicant" Then

lcSQL = "SELECT COUNT(ecotype) AS ecocount FROM
notificationcon fig " & _
"WHERE ecotype = '" & lcECOType & "' AND jobrole =
'" & lcJobRole & "' AND deptfunction = '" & lcDeptFunction & "'"
Set RSECOCount =
NotificationDat abaseConn.Execu te(lcSQL)

If RSECOCount("eco count") > 0 Then

lcSQL = "SELECT sequence, changestage, ecotype FROM
notificationcon fig " & _
"WHERE ecotype = '" & lcECOType & "' AND jobrole =
'" & lcJobRole & "' AND deptfunction = '" & lcDeptFunction & "'"
Set RSECOConfigDeta ils =
NotificationDat abaseConn.Execu te(lcSQL)

lcSequence = RSECOConfigDeta ils("sequence")
lcChangeStage = RSECOConfigDeta ils("changestag e")
lcECOType = RSECOConfigDeta ils("ecotype")

lcECOPersonId = RSECODetails("B EARB_PRS_ID")
lcSQL = "SELECT S_USER, S_FIRST_NAME, S_EMAIL FROM
PLMAD_PROD.T_PR S_DAT WHERE EDB_ID = '" & lcECOPersonId & "'"
Set RSPersonDetails = CADIMDatabaseCo nn.Execute(lcSQ L)

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 = NotificationDat abaseConn.Execu te(lcSQL)

Else

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

lcBodyError = "<html><head><m eta http-equiv='Content-Language'
content='en-us'><meta http-equiv='Content-Type' content='text/html;
charset=windows-1252'><title>CA DIM EC Action
Requirements</title></head><body><fon t 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>Departm ent Function: </b>" &
lcDeptFunction & "<br>"
lcBodyError = lcBodyError & "<b>Job Role: </b>" & lcJobRole &
"<br>"
lcBodyError = lcBodyError & "</font></body></html>"

Set cdoConfig = CreateObject("C DO.Configuratio n")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("C DO.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.Mo veNext
Loop
End If

RSECOList.MoveN ext
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 = NotificationDat abaseConn.Execu te(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 ("changestag e")
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 " & _
"changestag e = '" & lcChangeStage & "' And " & _
"sequence = " & lcSequence & " And " & _
"jobrole = '" & lcJobRole & "' And " & _
"deptfuncti on = '" & lcDeptFunction & "' And " & _
"firstname = '" & lcFirstName & "' And " & _
"lastname = '" & lcLastName & "' And " & _
"emailaddre ss = '" & lceMailAddress & "'"

Set RSUpdate = NotificationDat abaseConn.Execu te(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 = NotificationDat abaseConn.Execu te(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 = NotificationDat abaseConn.Execu te(lcSQL)
lcOldeMail = ""
lceMailBody = ""
lcBodyTableRecs = ""
lcFirst = "True"

Do While Not RSNotifications .EOF

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

Set cdoConfig = CreateObject("C DO.Configuratio n")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("C DO.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 ("changestag e")
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("C DO.Configuratio n")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("C DO.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
CADIMDatabaseCo nn.Close
NotificationDat abaseConn.Close
%>

Jun 29 '06 #1
4 3885
wrote on 29 jun 2006 in microsoft.publi c.inetserver.as p.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.10 9.133.242>
wrote on 29 jun 2006 in microsoft.publi c.inetserver.as p.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
cdoSendUsingPor t, 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 cdoSendUsingPor t = 2

The most common pitfalls when switching over:
- forgetting to change response.write to either msgbox or
logfile.writeli ne
- 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.createob ject to createobject
- removing things like server.transfer / response.redire ct - 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.CreateOb ject("ADODB.Con nection") to CreateObject("A DODB.Connection ")
and changing Server.MapPath( "../cadim/data/notifications.m db") to a local
path (e.g. c:\inetpub\wwwr oot\cadim\data\ notifications.m db).


<an***********@ siemens.com> wrote in message
news:11******** **************@ d56g2000cwd.goo glegroups.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 NotificationDat abaseConn = Server.CreateOb ject("ADODB.Con nection")
NotificationDat abaseConn.Open "Data Source=" &
Server.Mappath( "../cadim/data/notifications.m db") &
";Provider=Micr osoft.Jet.OLEDB .4.0;"

lcSQL = "SELECT CADIMUser, CADIMUserPasswo rd, SMTPServer, eMailAdmin
FROM SystemConfig"
Set RSSystemDefault s = NotificationDat abaseConn.Execu te(lcSQL)

lcCADIMUser = RSSystemDefault s ("CADIMUser" )
lcCADIMUserPass word = RSSystemDefault s ("CADIMUserPass word")
lcSMTPServer = RSSystemDefault s ("SMTPServer ")
lceMailAdmin = RSSystemDefault s ("eMailAdmin ")

' Create a connection to the CADIM database and open it.
Set CADIMDatabaseCo nn = Server.CreateOb ject("ADODB.Con nection")
CADIMDatabaseCo nn.Open "dsn=CADIMProdu ctionDB;uid=" & lcCADIMUser &
";pwd=" & lcCADIMUserPass word & ";"

' Delete all the previous notifications
lcSQL = "DELETE * FROM Notifications"
Set RSDeleteNotific ations = NotificationDat abaseConn.Execu te(lcSQL)
' Create a simple SQL Select statement for testing.
lcSQL = "SELECT C_ID, ELEM_ID, S010000_AEND_AR T_ENG FROM
PLMAD_PROD.T_EW O_DAT WHERE S010000_ORG_EIN H='013060' AND (LEV_IND =
'605' OR LEV_IND = '610') AND S010000_AEND_AR T_ENG <> 'Normal change A
doc'"

Set RSECOList = CADIMDatabaseCo nn.Execute(lcSQ L)

Do While Not RSECOList.EOF
lcECOType = RSECOList("S010 000_AEND_ART_EN G")
lcECOID = RSECOList("C_ID ")
lcECONum = RSECOList("ELEM _ID")

lcSQL = "SELECT BEARB_PRS_ID, FUNKTION, BEREICH, MAIL_AUSG, OK_KZ
FROM PLMAD_PROD.T_S0 10000EWOM WHERE C_ID_1 = '" & lcECOID & "' AND
OK_KZ = '_'"
Set RSECODetails = CADIMDatabaseCo nn.Execute(lcSQ L)

lcApplicantSent RequestForAppro val = "False"
Do While Not RSECODetails.EO F
If Not IsNull(RSECODet ails("MAIL_AUSG ")) Or
Len(RSECODetail s("MAIL_AUSG" )) <> 0 Then
lcApplicantSent RequestForAppro val = "True"
End If
RSECODetails.Mo veNext
Loop
' Loop through the details again now we know someone has been
' notified once to approve the change and build the notification
table

If lcApplicantSent RequestForAppro val = "True" Then
RSECODetails.Mo veFirst
Do While Not RSECODetails.EO F

lcDeptFunction = RSECODetails("B EREICH")
lcJobRole = RSECODetails("F UNKTION")

If lcJobRole <> "Applicant" Then

lcSQL = "SELECT COUNT(ecotype) AS ecocount FROM
notificationcon fig " & _
"WHERE ecotype = '" & lcECOType & "' AND jobrole =
'" & lcJobRole & "' AND deptfunction = '" & lcDeptFunction & "'"
Set RSECOCount =
NotificationDat abaseConn.Execu te(lcSQL)

If RSECOCount("eco count") > 0 Then

lcSQL = "SELECT sequence, changestage, ecotype FROM
notificationcon fig " & _
"WHERE ecotype = '" & lcECOType & "' AND jobrole =
'" & lcJobRole & "' AND deptfunction = '" & lcDeptFunction & "'"
Set RSECOConfigDeta ils =
NotificationDat abaseConn.Execu te(lcSQL)

lcSequence = RSECOConfigDeta ils("sequence")
lcChangeStage = RSECOConfigDeta ils("changestag e")
lcECOType = RSECOConfigDeta ils("ecotype")

lcECOPersonId = RSECODetails("B EARB_PRS_ID")
lcSQL = "SELECT S_USER, S_FIRST_NAME, S_EMAIL FROM
PLMAD_PROD.T_PR S_DAT WHERE EDB_ID = '" & lcECOPersonId & "'"
Set RSPersonDetails = CADIMDatabaseCo nn.Execute(lcSQ L)

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 = NotificationDat abaseConn.Execu te(lcSQL)

Else

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

lcBodyError = "<html><head><m eta http-equiv='Content-Language'
content='en-us'><meta http-equiv='Content-Type' content='text/html;
charset=windows-1252'><title>CA DIM EC Action
Requirements</title></head><body><fon t 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>Departm ent Function: </b>" &
lcDeptFunction & "<br>"
lcBodyError = lcBodyError & "<b>Job Role: </b>" & lcJobRole &
"<br>"
lcBodyError = lcBodyError & "</font></body></html>"

Set cdoConfig = CreateObject("C DO.Configuratio n")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("C DO.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.Mo veNext
Loop
End If

RSECOList.MoveN ext
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 = NotificationDat abaseConn.Execu te(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 ("changestag e")
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 " & _
"changestag e = '" & lcChangeStage & "' And " & _
"sequence = " & lcSequence & " And " & _
"jobrole = '" & lcJobRole & "' And " & _
"deptfuncti on = '" & lcDeptFunction & "' And " & _
"firstname = '" & lcFirstName & "' And " & _
"lastname = '" & lcLastName & "' And " & _
"emailaddre ss = '" & lceMailAddress & "'"

Set RSUpdate = NotificationDat abaseConn.Execu te(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 = NotificationDat abaseConn.Execu te(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 = NotificationDat abaseConn.Execu te(lcSQL)
lcOldeMail = ""
lceMailBody = ""
lcBodyTableRecs = ""
lcFirst = "True"

Do While Not RSNotifications .EOF

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

Set cdoConfig = CreateObject("C DO.Configuratio n")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("C DO.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 ("changestag e")
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("C DO.Configuratio n")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = lcSMTPServer
.Update
End With

Set cdoMessage = CreateObject("C DO.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
CADIMDatabaseCo nn.Close
NotificationDat abaseConn.Close
%>

Jun 30 '06 #5

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

Similar topics

2
8278
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 somebody else has allready opened that file, you must get a requester that says the file is temporarily unavaillable because it is edited somewere else.
2
1333
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, 2006-10-15 etc. then some times: 20sec, 50sec, 45sec etc and some quantity of parts: 200, 300, 240 --------------------------------------------------------------------- I must sort dates,times and quanties, then I must calculate:for ex. 2006-01-01+200*20, etc. and then add next date+quanntity*time....
0
2415
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 FormView is like this::--- <asp:FormView ID="FormView1" runat="server" DataSourceID="ObjectDataSource1"> <EditItemTemplate>
14
1408
by: bbawa1 | last post by:
It says invalid expression term && protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if ((Convert.ToInt32(e.Row.Cells.Text)>=15))&&(Convert.ToInt32(e.Row.Cells.Text)>=17); {
0
1556
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 = format.parse(convert); code is down--------please help me...... for(int i=0;i<values.length;i++) { String convert=values;
14
1304
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 implementing a python program
5
1722
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 As String Dim imageText As String Dim bm As Bitmap Dim ms As MemoryStream imageFolder = Request.QueryString(imFolder)
4
2040
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 what I want as I know even less about c than I do about VB :) I have chopped the code a bit so I hope it makes enough sense, what I am trying to do is load a remote registry in from a server , make some changes and then unload it.later. I have google'd quite a bit but I can only find C or VB6...
9
3195
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" > 8. <option></option> 9. <option>north</option> 10. <option>south</option>
0
8678
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9166
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9030
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6525
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2333
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.