Can all of u please help to check wheher the following code is correct? The purpose of the code is that it will enable to user to know their password when they type in their email.
But they gave me this error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'from'.
/mailpwd1.asp, line 28
<%Option Explicit%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
Dim DataConn, ConnString
Dim SQL, myEmail, oRs
Dim Email2, password2
Dim MyMail
myEmail=Request.Form ("text1"
Set DataConn = Server.CreateObject("ADODB.Connection"
ConnString="driver={sql server};server=CON7; database=user;DSN=localserver;PWD=sa;UID=sa;"
DataConn.Open ConnString
SQL="select * from password, email from info where email='" & myEmail &"'"
Set oRs= Server.CreateObject ("ADODB.recordset"
oRs.Open SQL, DataConn, 3 line 28
If oRs.EOF Then
response.write "<html><head><body bgcolor='#000000' text='#ffff00'><center>"
Response.Write "<font face='verdana' size='+2'><p>"
Response.Write "No records found:<p> Use the browser's back button to go back and try again"
Response.Write "</font></body></html>"
Response.End
end if
Email2=oRs("myEmail"
password2=oRs("password"
oRs.Close
Set oRs=nothing
Set MyMail = Server.CreateObject("CDONTS.NewMail"
MyMail.From="yoursys@system.com"
MyMail.To = Email2
MyMail.Subject ="Your Password"
MyMail.Body= password2
MyMail.Send
Set MyMail= nothing
%>
Thank you!!
X-)
But they gave me this error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'from'.
/mailpwd1.asp, line 28
<%Option Explicit%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
Dim DataConn, ConnString
Dim SQL, myEmail, oRs
Dim Email2, password2
Dim MyMail
myEmail=Request.Form ("text1"
Set DataConn = Server.CreateObject("ADODB.Connection"
ConnString="driver={sql server};server=CON7; database=user;DSN=localserver;PWD=sa;UID=sa;"
DataConn.Open ConnString
SQL="select * from password, email from info where email='" & myEmail &"'"
Set oRs= Server.CreateObject ("ADODB.recordset"
oRs.Open SQL, DataConn, 3 line 28
If oRs.EOF Then
response.write "<html><head><body bgcolor='#000000' text='#ffff00'><center>"
Response.Write "<font face='verdana' size='+2'><p>"
Response.Write "No records found:<p> Use the browser's back button to go back and try again"
Response.Write "</font></body></html>"
Response.End
end if
Email2=oRs("myEmail"
password2=oRs("password"
oRs.Close
Set oRs=nothing
Set MyMail = Server.CreateObject("CDONTS.NewMail"
MyMail.From="yoursys@system.com"
MyMail.To = Email2
MyMail.Subject ="Your Password"
MyMail.Body= password2
MyMail.Send
Set MyMail= nothing
%>
Thank you!!
X-)