Please check and provide solution for my code

Reply

Join Date: Jul 2004
Posts: 1
Reputation: Pradhuman is an unknown quantity at this point 
Solved Threads: 0
Pradhuman Pradhuman is offline Offline
Newbie Poster

Please check and provide solution for my code

 
0
  #1
Jul 14th, 2004
<%@ Language=VBScript %>
<html>
<head>
<title>Furniture4all.com</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="links.css" type="text/css">
</head>
<body bgcolor="#800080" text="#FFFFFF" leftmargin="0" topmargin="0">
<%
function traceLine(str)
traceLine = replace(str, chr(13), "<br>")
end function

dim con, rs, id, pass, sNo
set con= server.CreateObject("ADODB.Connection")
set rs = server.CreateObject("ADODB.Recordset")
set rs1 = server.CreateObject("ADODB.Recordset")

name=session("userName")
pass=session("password")

con.Open "Provider=Microsoft.jet.OLEDB.4.0; data Source = " & server.MapPath("../FurnitureData.mdb")
rs.Open "SELECT * FROM adminUser WHERE adminName='"&name&"' AND adminPassword='"&pass&"'", con
if rs.EOF then
Response.Write "Unauthorised to access, Username or Password is incorrect"
Response.End
end if
rs.Close

id = Request.QueryString("id")

rs.Open "SELECT * FROM Feedback WHERE id="&id&"",con
Response.Write "<table width='100%'>"
if not rs.EOF then
uID= rs("FirstName")
rs1.Open "SELECT * FROM Feedback WHERE uId='"&FirstName&"'", con
str = str & "<table width=60% align=center border=1>"
str = str & "<tr bgcolor=darkblue><td colspan=2><FONT color=white style='BACKGROUND-COLOR: #00008b'><STRONG>User Information</STRONG></FONT>"
str = str & "<tr><td>FirstName<td>&nbsp;" & rs("firstname")
str = str & "<tr><td>Last Name<td>&nbsp;" & rs("LastName")
str = str & "<tr><td>Sex<td>&nbsp;" & rs("sex")
str = str & "<tr><td>Age<td>&nbsp;" & rs("age")
str = str & "<tr><td>Address<td>&nbsp;" & rs("HouseNo")
str = str & "<tr><td>&nbsp;<td>&nbsp;" & rs("Locality")
str = str & "<tr><td>City<td>&nbsp;" & rs("city")
str = str & "<tr><td>State<td>&nbsp;" & rs("state")
str = str & "<tr><td>Country<td>&nbsp;" & rs("country")
str = str & "<tr><td>Zip<td>&nbsp;" & rs("zip")
str = str & "<tr><td>Phone<td>&nbsp;" & rs("Phone")
str = str & "<tr><td>Email<td>&nbsp;" & rs("email")
str = str & "<tr><td>Query<td>&nbsp;" & traceline(rs("comment"))
Response.Write str
%><form action="replyQuery.asp" method=post id=form1 name=form1>
<tr>
<td>Answer
<td>
<input type=hidden value=<%=id%> name=id>
<textarea name=ans rows=10 cols=50><%=rs("answer")%></textArea>
<tr>
<td>&nbsp;
<td>
<input type=submit value="Submit" id=submit1 name=submit1></form>
<%
rs1.Close
end if
rs.Close
%>
<tr>
<td>&nbsp;
<td>&nbsp;
<tr>
<td>&nbsp;
<td>&nbsp;
</table>

<div align="left"></body>
</html>
Reply With Quote Quick reply to this message  
Join Date: Jul 2004
Posts: 32
Reputation: RobUK is an unknown quantity at this point 
Solved Threads: 1
RobUK RobUK is offline Offline
Light Poster

Re: Please check and provide solution for my code

 
0
  #2
Jul 14th, 2004
what exactly is wrong here?
Rob - DMOZ Editor
Web Design Forums - Free website critiques. Web design + SEO Advice
Reply With Quote Quick reply to this message  
Join Date: Apr 2004
Posts: 167
Reputation: Drew is an unknown quantity at this point 
Solved Threads: 7
Drew's Avatar
Drew Drew is offline Offline
Junior Poster

Re: Please check and provide solution for my code

 
0
  #3
Jul 16th, 2004
Looks like the second SQL statement is missing a quote at the end.
Drew Gauderman
ASP / MSSQL Coder
http://www.iportalx.net - My ASP Portal
Reply With Quote Quick reply to this message  
Join Date: Feb 2004
Posts: 4
Reputation: Ral is an unknown quantity at this point 
Solved Threads: 0
Ral Ral is offline Offline
Newbie Poster

Re: Please check and provide solution for my code

 
0
  #4
Jul 23rd, 2004
Actually the problem is this line: rs.Open "SELECT * FROM Feedback WHERE id="&id&"",con

You can't use a variable called id since it is a reserved word in ASP. It is good practice to mark your variables to something similar like this:

If you are using a character var start it with c_variablename, bit then b_varname, integer use i_varname. That way you won't run into reserved variable names while programming.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC