I've developed a console app that is not working as expected. (This is my first console app - my experience with vb.net is in Asp.net.
My client has several Access users with an Access app that is used to send out email from a Sql Server database of 130k customers. Each email is individually addressed.
The VB.net console app gets two arguments from Access that identifies one record in Sql Server that can be used to get and send the mailing list.
Here's the basic flow of the VB.net app:
The problem: when a second user sends the arguments, nothing happened.
My client has several Access users with an Access app that is used to send out email from a Sql Server database of 130k customers. Each email is individually addressed.
The VB.net console app gets two arguments from Access that identifies one record in Sql Server that can be used to get and send the mailing list.
Here's the basic flow of the VB.net app:
Sub Main() Dim intEmailCampaignId As Integer = 0 Dim blnStopSendingCurrentEmailCampaign As Boolean Dim strArgs() As String = Environment.GetCommandLineArgs() intEmailCampaignId = CInt(strArgs(1)) blnStopSendingCurrentEmailCampaign = CBool(strArgs(2)) Dim objSend As New PrepareSendEmail objSend.DetermineAction(intEmailCampaignId, blnStopSendingCurrentEmailCampaign) objSend = Nothing End Sub Public Sub DetermineAction(intEmailCampaignId As Integer, blnStopSendingCurrentEmailCampaign As Boolean) If blnStopSendingCurrentEmailCampaign = True Then 'stop sending this campaign StopSendCampaignEmail(intEmailCampaignId) Else 'prepare email for sending intCurrentEmailCampaignId = intEmailCampaignId GetCampaignData(intCurrentEmailCampaignId) End If End Sub Private Sub GetCampaignData(intCurrentEmailCampaignId As Integer) 'Gets the record for the Campaign from tblEmailCampaigns, including the Jet sql for the insert Public Sub CreateSendToRecordsFromInsertQuery(strEmailToQuerySql As String) 'gets the Jet INSERT Sql and converts it to T-SQL for use with Sql Server, where it runs the insert ' to create the records for sending Private Sub GetSendToRecords() 'Gets the records inserted to start the send process by creating each email, then loops through ' the recordset sending each email
The problem: when a second user sends the arguments, nothing happened.
Last edited by a moderator: