•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 456,433 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,642 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 3015 | Replies: 3
![]() |
•
•
Join Date: Jul 2004
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
<%@ 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> " & rs("firstname")
str = str & "<tr><td>Last Name<td> " & rs("LastName")
str = str & "<tr><td>Sex<td> " & rs("sex")
str = str & "<tr><td>Age<td> " & rs("age")
str = str & "<tr><td>Address<td> " & rs("HouseNo")
str = str & "<tr><td> <td> " & rs("Locality")
str = str & "<tr><td>City<td> " & rs("city")
str = str & "<tr><td>State<td> " & rs("state")
str = str & "<tr><td>Country<td> " & rs("country")
str = str & "<tr><td>Zip<td> " & rs("zip")
str = str & "<tr><td>Phone<td> " & rs("Phone")
str = str & "<tr><td>Email<td> " & rs("email")
str = str & "<tr><td>Query<td> " & 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>
<td>
<input type=submit value="Submit" id=submit1 name=submit1></form>
<%
rs1.Close
end if
rs.Close
%>
<tr>
<td>
<td>
<tr>
<td>
<td>
</table>
<div align="left"></body>
</html>
<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> " & rs("firstname")
str = str & "<tr><td>Last Name<td> " & rs("LastName")
str = str & "<tr><td>Sex<td> " & rs("sex")
str = str & "<tr><td>Age<td> " & rs("age")
str = str & "<tr><td>Address<td> " & rs("HouseNo")
str = str & "<tr><td> <td> " & rs("Locality")
str = str & "<tr><td>City<td> " & rs("city")
str = str & "<tr><td>State<td> " & rs("state")
str = str & "<tr><td>Country<td> " & rs("country")
str = str & "<tr><td>Zip<td> " & rs("zip")
str = str & "<tr><td>Phone<td> " & rs("Phone")
str = str & "<tr><td>Email<td> " & rs("email")
str = str & "<tr><td>Query<td> " & 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>
<td>
<input type=submit value="Submit" id=submit1 name=submit1></form>
<%
rs1.Close
end if
rs.Close
%>
<tr>
<td>
<td>
<tr>
<td>
<td>
</table>
<div align="left"></body>
</html>
•
•
Join Date: Jul 2004
Posts: 32
Reputation:
Rep Power: 5
Solved Threads: 1
what exactly is wrong here?
•
•
Join Date: Apr 2004
Location: Springfield, Oregon
Posts: 121
Reputation:
Rep Power: 5
Solved Threads: 6
Looks like the second SQL statement is missing a quote at the end.
•
•
Join Date: Feb 2004
Posts: 4
Reputation:
Rep Power: 0
Solved Threads: 0
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.
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.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
.net access activation ajax api asp blogger blogging blogs code combo crm custom dani daniweb data debugging development dropdownlist erp feed gdata google gpl innovation key linux marketing microsoft module net news office openbsd product programming reader reuse rss serial skin solution sales source tags theme vista web wysiwyg xml
- Updated : Simple ASP.Net Login Page (ASP.NET)
- How to check data type (Visual Basic 4 / 5 / 6)
- code tags (DaniWeb Community Feedback)
- Processing multiple word docs (Visual Basic 4 / 5 / 6)
- Need help in VB6 database programming (Visual Basic 4 / 5 / 6)
- dhtml menu and flash (JavaScript / DHTML / AJAX)
Other Threads in the ASP Forum
- Previous Thread: Requesting Querystring
- Next Thread: Search by Zip Radius


Linear Mode