Hi I have created an access database which keeps a record of renting out laptops to people. I use asp to connect to my web pages where the details of name , address etc can be typed in. I have a lend button which allows one to type in the details and then updtae the details to the database. I also have a button that indicates that the laptop is rented out and all I want to do is when one clicks on that button it shows the details of whom the laptop is rented out to. It sounds so simple and I have it almost complete I jsu cant get it to pull up the details. I have tried response. write. Maybe someone can help, please. Thank you.
Here is my page of code. The problem is the sql statement it says there is a data mismatch but I cant see it.
<% @LANGUAGE="VBSCRIPT"%>
<%
Dim dbconn
Dim LaptopID, Lendee, Location, Phone, ltID , rs1, sql, In_Out
' Create and establish data connection
Set dbconn = Server.CreateObject("ADODB.Connection")
dbconn.ConnectionTimeout = 15
dbconn.CommandTimeout = 30
'Use this line to use Access
dbconn.Open "DBQ= "& Server.MapPath("laptops.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;MaxBufferSize=8192;Threads=20 ;"
%>
<%
' Create recordset and retrieve values using the open connection
Set rs1 = Server.CreateObject("ADODB.Recordset")
' Opening record set with a forward-only cursor (the 0) and in read-only mode (the 1)
rs1.Open "SELECT Lendee, Location, phone, In_Out FROM LaptopDetails Where LaptopID='" & ltID & "'", dbconn
%>
<%
if request.querystring("LaptopID")<>"" then
ltID=request.querystring("LaptopID")
end if
if request.querystring("LaptopID")<>"" then ltID=request.querystring("LaptopID")end if
if Request.querystring("Lendee") <> "" then Lendee=request.querystring("Lendee")end if
if Request.querystring("Location") <> "" then Location=Request.querystring("Location")end if
if Request.querystring("Phone") <> "" then Phone=Request.querystring("Phone") end if
%>
<html>
<body>
<h2>Lend Details</h2>
<p><font color="#FF0000">LaptopID: </font><%Response.write (LaptopID)%>
<p><font color="#FF0000">Name: </font><%Response.write (Lendee)%>
<p><font color="#FF0000">Address: </font><%Response.write (Location)%>
<p><font color="#FF0000">Telephone: </font><%Response.write (Phone)%>
<% dbconn.close %>