|
 |
asp_databases thread: Re: asp_databases digest: September 13, 2000
Message #1 by "Bill Sisemore" <bsisemore@m...> on Thu, 14 Sep 2000 09:57:36 -0400
|
|
Below is the code from an ASP page that is supposed to accept input from
a form on a previous page. I am using the POST method in the form
properties that calls this file. There is a text box that passes a users
email address to the variable "txtemail". What I want to do is to view
all "issues" from "Table1" of the DSN "helpdesk" for the email address
defined in the "txtemail" form field posted from the previous page.
I do not get errors when I run this script, neither do I get results even
though records matching the "txtemail" value do exist in the Access 2000
database file.
I would appreciate anyone, someone pointing out the problem area.
<%
stremail = cStr(Request.Form("txtemail"))
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open "helpdesk"
sSQL = "SELECT issue FROM Table1 WHERE email='stremail'"
Set objRS = objConn.Execute(sSQL)
Do While NOT objRS.EOF
Response.Write(objRS.Fields("issue"))
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
Message #2 by Imar Spaanjaars <Imar@S...> on Thu, 14 Sep 2000 16:32:59 +0200
|
|
You query for the word strEmail, not for the value of the string strEmail.
Try this instead:
sSQL = "SELECT issue FROM Table1 WHERE email = '" & stremail & "'"
Imar
At 09:57 AM 9/14/2000 -0400, you wrote:
>Below is the code from an ASP page that is supposed to accept input from
>a form on a previous page. I am using the POST method in the form
>properties that calls this file. There is a text box that passes a users
>email address to the variable "txtemail". What I want to do is to view
>all "issues" from "Table1" of the DSN "helpdesk" for the email address
>defined in the "txtemail" form field posted from the previous page.
>
>I do not get errors when I run this script, neither do I get results even
>though records matching the "txtemail" value do exist in the Access 2000
>database file.
>
>I would appreciate anyone, someone pointing out the problem area.
>
><%
>
>stremail = cStr(Request.Form("txtemail"))
>
>Set objConn = Server.CreateObject("ADODB.Connection")
>Set objRS = Server.CreateObject("ADODB.Recordset")
>
>objConn.Open "helpdesk"
>
>sSQL = "SELECT issue FROM Table1 WHERE email='stremail'"
>
>Set objRS = objConn.Execute(sSQL)
>
>Do While NOT objRS.EOF
> Response.Write(objRS.Fields("issue"))
> objRS.MoveNext
>Loop
>
>objRS.Close
>Set objRS = Nothing
>
>objConn.Close
>Set objConn = Nothing
>
>%>
Message #3 by =?iso-8859-1?Q?Gonzalo_Ruiz_de_Villa_Su=E1rez?= <gonzalo.ruizdevilla@a...> on Thu, 14 Sep 2000 17:14:30 +0200
|
|
Well, I understand that with
sSQL = "SELECT issue FROM Table1 WHERE email='stremail'"
you mean
sSQL = "SELECT issue FROM Table1 WHERE email='" & stremail & "'"
Hope it helps.
Regards,
Gonzalo
-----Mensaje original-----
De: Bill Sisemore [mailto:bsisemore@m...]
Enviado el: jueves, 14 de septiembre de 2000 15:58
Para: ASP Databases
Asunto: [asp_databases] Re: asp_databases digest: September 13, 2000
Below is the code from an ASP page that is supposed to accept input from
a form on a previous page. I am using the POST method in the form
properties that calls this file. There is a text box that passes a users
email address to the variable "txtemail". What I want to do is to view
all "issues" from "Table1" of the DSN "helpdesk" for the email address
defined in the "txtemail" form field posted from the previous page.
I do not get errors when I run this script, neither do I get results even
though records matching the "txtemail" value do exist in the Access 2000
database file.
I would appreciate anyone, someone pointing out the problem area.
<%
stremail = cStr(Request.Form("txtemail"))
Set objConn = Server.CreateObject("ADODB.Connection")
Set objRS = Server.CreateObject("ADODB.Recordset")
objConn.Open "helpdesk"
sSQL = "SELECT issue FROM Table1 WHERE email='stremail'"
Set objRS = objConn.Execute(sSQL)
Do While NOT objRS.EOF
Response.Write(objRS.Fields("issue"))
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
%>
|
|
 |