Sub Main() Dim database As New ADODB.Connection Dim records As New ADODB.Recordset Dim sql As String Dim phones As String Dim numto As Long numto=MSG.NumTo Dim recip As Variant On Error GoTo erl database.ConnectionString="Provider=sqloledb; Data Source=192.168.2.121\EMMSDE;Initial Catalog=outlookreport; User Id=jsmith; Password=s5993153492;" database.Open If (numto > 0) Then For i = 0 To numto - 1 recip = Array(MSG.GetToAddr(i)) For Each itm In Array(MSG.GetToAddr(i)) sql = "SELECT * FROM OUTLOOKREPORT.DBO.MFUSERS where username='" & recip & "'" records.Open sql,database, adOpenForwardOnly, adLockReadOnly If records.EOF=False Then MSG.SaveEml("I:\Mail\" & MSG_UID & Format(Date,"yyyymmdd") & Format(Time,"hhmmss") & ".eml") Email2DBAccept=False Next itm 'This is where we conver to eml 'End Code on it Call AddToLog("Message Posted to Online Portal") Else Email2DBAccept = True End If records.Close database.Close Exit Sub Next End If 'select the record we want erl: Call AddToLog("Script Errror: " & Err.Description) End Sub
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: