AirTaZ
Jan 25th, 2002, 10:25 PM
situation:
Over the internet the user will click a submit button. The form contents will be entered in a database. Once done my "future" dll will send a confirmation email to the user. I have it working fine in just vb. It will send the email when the button is clicked. How can I use this code to make a dll to handle this?
Option Explicit
Private Sub Command1_Click()
Dim strResult As String
strResult = SendMail()
End Sub
Public Function SendMail() As String
Dim merchInfo As String
Dim cdoMsg As New CDO.Message
merchInfo = "544068086123456"
SendMail = MerchInfo
'Assign Adodc1 to Merch Info
Adodc1.RecordSource = "select * from tblMerchEmail where MID = '" & merchInfo & "' "
Adodc1.Refresh
'Get info from database to send
With Adodc1.Recordset
cdoMsg.To = .Fields!ToEmail
cdoMsg.From = .Fields!FromEmail
cdoMsg.Subject = .Fields!Subject
cdoMsg.TextBody = .Fields!Info
cdoMsg.Send
End With
End Function
The error I am now getting is "Adodc1" variable not defined. I referenced the same as I did in my VB project. If anyone can recommend a beginners tutorial that is geared toward my situation. Thanks.
Over the internet the user will click a submit button. The form contents will be entered in a database. Once done my "future" dll will send a confirmation email to the user. I have it working fine in just vb. It will send the email when the button is clicked. How can I use this code to make a dll to handle this?
Option Explicit
Private Sub Command1_Click()
Dim strResult As String
strResult = SendMail()
End Sub
Public Function SendMail() As String
Dim merchInfo As String
Dim cdoMsg As New CDO.Message
merchInfo = "544068086123456"
SendMail = MerchInfo
'Assign Adodc1 to Merch Info
Adodc1.RecordSource = "select * from tblMerchEmail where MID = '" & merchInfo & "' "
Adodc1.Refresh
'Get info from database to send
With Adodc1.Recordset
cdoMsg.To = .Fields!ToEmail
cdoMsg.From = .Fields!FromEmail
cdoMsg.Subject = .Fields!Subject
cdoMsg.TextBody = .Fields!Info
cdoMsg.Send
End With
End Function
The error I am now getting is "Adodc1" variable not defined. I referenced the same as I did in my VB project. If anyone can recommend a beginners tutorial that is geared toward my situation. Thanks.