FP 2000 SQL 2000: Confirmation page using an asp script to generate a max(id) and email the results

B

Bill

Hi,

I am using the following script in order to attempt to get the max ID from
the respective table and email the results as a URL to the EMAIL CDONTS
listed in the script. The problem is the asp script on the confirmation
page is not sending any email out and I am not sure why. IF I remove the
SQL portion of the script and just do the email portion, it works fine, but
the email sent is generic and does not include any indication of the ID. Is
there another way to get the max(id) via asp on a confirmation page? I am
using a DRW to display the max ID on the confirmation page for the end user
in the gui. Any comments would be appreciated! Script is below:

Thanks

<%
myDSN = "Driver=SQL Server;Server=CCC;Database=CCC;UID=CCC;PWD=CCC"
strSQL=("select max(id) from problem")

set Connect=server.createobject("adodb.connection")
Connect.open myDSN
set Connect=conntemp.execute(strSQL)

If Connect.eof then
'Do something for no record found
else
strID = rs(0)
end if

Connect.close
set Connect=nothing

Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.From = "(e-mail address removed)"
'objCDOMail.To = strEmail
objCDOMail.To = "(e-mail address removed)"

objCDOMail.Subject = strSubject
strSubject="Here is the subject"
strBody = "Here is some text in the body"
strBody = strBody & Chr(13) & "Now here's the link:" & Chr(13)
strBody= strBody & "http://ccc/maintenance_problem_form.asp?ID="& strID & ""
objCDOMail.Body = strBody
objCDOMail.Send
Set objCDOMail = Nothing
%>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top