954,566 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Please check and provide solution for my code


<%
function traceLine(str)
traceLine = replace(str, chr(13), "
")
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 ""
if not rs.EOF then
uID= rs("FirstName")
rs1.Open "SELECT * FROM Feedback WHERE uId='"&FirstName&"'", con
str = str & ""
str = str & "User Information"
str = str & "FirstName " & rs("firstname")
str = str & "Last Name " & rs("LastName")
str = str & "Sex " & rs("sex")
str = str & "Age " & rs("age")
str = str & "Address " & rs("HouseNo")
str = str & "  " & rs("Locality")
str = str & "City " & rs("city")
str = str & "State " & rs("state")
str = str & "Country " & rs("country")
str = str & "Zip " & rs("zip")
str = str & "Phone " & rs("Phone")
str = str & "Email " & rs("email")
str = str & "Query " & traceline(rs("comment"))
Response.Write str
%>
Answer

name=id>
<%=rs("answer")%> 


<%
rs1.Close
end if
rs.Close
%>
 
 
 
 

Pradhuman
Newbie Poster
1 post since Jul 2004
Reputation Points: 10
Solved Threads: 0
 

what exactly is wrong here?

RobUK
Light Poster
32 posts since Jul 2004
Reputation Points: 10
Solved Threads: 1
 

Looks like the second SQL statement is missing a quote at the end.

Drew
Junior Poster
166 posts since Apr 2004
Reputation Points: 25
Solved Threads: 7
 

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.

Ral
Newbie Poster
4 posts since Feb 2004
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You