I have a form that the user enters the data and then clicks on email. At this point the data is emailed to another user. For some reason my data source is now showing as read-only, can someone tell me how to fix this? The other problem is this code is not executing at all, Can someone tell me what I need to do to get this code to execute?
Thank you for your help, it is greatly appreciated.
<%@ language=vbscript %>
<% Option Explicit %>
<%
Dim Conn, rs, sqlStatement, strHost, Msg
Set Conn = CreateObject("ADODB.Connection"
Conn.Open = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Forms;Data Source=SEIMS"
Conn.CursorLocation = adUseServer
sqlStatement = "dbo_Contractors"
Set rs = CreateObject("ADODB.Recordset"
rs.open sqlStatement, Conn,,adLockOptimistic, adCmdTable
strHost = "mail.aepnet.com"
Set Mail = CreateObject("Persits.MailSender"
Mail.Host = strHost
'format the new mail message
Mail.From = "schapman@aepnet.org"
Mail.AddAddress "schapman@aepnet.org"
' message subject
Mail.Subject = "Contractors Working At Apache"
' message attachment
'Mail.AddAttachment "g:\Inetpub\
' message body
'Msg.Body = Msg & rs("ContractorFirstName"
Msg = "Contractor Name: " & rs("ContractorFirstName"
Mail.Body = Msg
'SEND THE MAIL MESSAGE TO ITS RECIPIENTS
mail.Send
If Err <> 0 Then
Response.Write "An error occurred: " & Err.Description
End If
'DEFERENCE THE OBJECT AND DESTROY ITS INSTANCE
set Mail = Nothing
%>
Thank you for your help, it is greatly appreciated.
<%@ language=vbscript %>
<% Option Explicit %>
<%
Dim Conn, rs, sqlStatement, strHost, Msg
Set Conn = CreateObject("ADODB.Connection"
Conn.Open = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=Forms;Data Source=SEIMS"
Conn.CursorLocation = adUseServer
sqlStatement = "dbo_Contractors"
Set rs = CreateObject("ADODB.Recordset"
rs.open sqlStatement, Conn,,adLockOptimistic, adCmdTable
strHost = "mail.aepnet.com"
Set Mail = CreateObject("Persits.MailSender"
Mail.Host = strHost
'format the new mail message
Mail.From = "schapman@aepnet.org"
Mail.AddAddress "schapman@aepnet.org"
' message subject
Mail.Subject = "Contractors Working At Apache"
' message attachment
'Mail.AddAttachment "g:\Inetpub\
' message body
'Msg.Body = Msg & rs("ContractorFirstName"
Msg = "Contractor Name: " & rs("ContractorFirstName"
'SEND THE MAIL MESSAGE TO ITS RECIPIENTS
mail.Send
If Err <> 0 Then
Response.Write "An error occurred: " & Err.Description
End If
'DEFERENCE THE OBJECT AND DESTROY ITS INSTANCE
set Mail = Nothing
%>