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 |
|
brownd92
Starting Member
8 Posts |
Posted - 2005-03-15 : 10:31:17
|
| Here is the script.All the records in the database are being updated instead of just the records in the database.Any Ideas?''''''''''''''''''''''''''''''''''''''''''Option ExplicitOn Error Resume Next Function Main()Dim SentTime'set SentTime = now()'set senttime = day & Month & YearDim strEmailBody Dim iMsg Dim oRSDim objMail Dim oRsCSet oRs=DTSGlobalVariables("RSGetNotSent").ValueWhile Not oRS.EOF dim myDestConn Dim myDestSQL Set iMsg = CreateObject("CDO.Message") Set objMail = CreateObject("CDO.Message") ' Move to the next row in preparation for loop iteration 'Create the body of the email strEmailBody = "Good morning," & vbCrLf & _ "You have outdated content to update " & _ " Please click on this link to rectify " & _ "http://www.bustedmedia.com." ' 'Attach the file to an email and send it objMail.From = " youremail@email.com" objMail.To = oRS.Fields(3).Value objMail.Subject = "Content needing attention" objMail.TextBody = strEmailBody objMail.Send Set objMail = nothing set myDestConn = CreateObject("ADODB.Connection") myDestConn.Open = "Provider=SQLOLEDB.1;Data Source=(local); Initial Catalog=test;user id = 'obtree';password = 'obtree'" 'myDestSQL = "Update ObtreeEmail set emailStatus = 1, senttime=" & now() & " Where id =" & oRS.Fields(0).Value myDestSQL = "Update ObtreeEmail set emailStatus = 1 Where id =" & oRS.Fields(0).Value myDestConn.Execute myDestSQL set myDestConn = nothing oRS.MoveNextwendSet oRS = NothingSet oRsC = NothingMain = DTSTaskExecResult_Success End Function'''''''''''''''''''''''''''''''''''''''''''''''''''''Cheers |
|
|
|
|
|