I cannot seem to get a simple query in ASP to work... I get a numerical value from a form, but when I try to process it I get a data mismatch error.
My code is the following with error line in bold
I know that intcustomersearch is coming to the right number, because i have tested it with response.write
Any ideas?
My code is the following with error line in bold
Rich (BB code):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Welcome to the Kennels Database System - Animals Section</title>
<link href="external.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
font-size: 14px;
color: #000000;
}
-->
</style>
</head>
<body>
<center>
<!.. EXTRACTING RECORDSET AND CREATING QUERY ..>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("kennels.mdb"))
Session("customerid")=request("customerid")
intcustomersearch=session("customerid")
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "SELECT * FROM tblCustomers where customerid='intcustomersearch', conn
response.write intcustomersearch
%>
<!.. EXTRACTING VALUES FROM THE FIELDS ..>
<%
CustomerID=rs("CustomerID")
Title=rs("Title")
CustomerSurname=rs("CustomerSurname")
CustomerForename=rs("CustomerForename")
Address=rs("Address")
Postcode=rs("Postcode")
TelNumber=rs("TelNumber")
MobNumber=rs("MobNumber")
%>
<!.. TABLE OF RESULTS ..>
<% If rs.EOF <> True AND rs.BOF <> True Then
While NOT rs.EOF
%>
<table border="1" cellspacing=10>
<tr>
<th>Customer ID</th><td><%=rs("CustomerID")%></td></tr>
<tr><th>Title</th><td><%=rs("Title")%></td></tr>
<tr><th>Customer Surname</th><td><%=rs("CustomerSurname")%></td></tr>
<tr><th>Customer Forename</th><td><%=rs("CustomerForename")%></td></tr>
<tr><th>Address</th><td><%=rs("Address")%></td></tr>
<tr><th>Postcode</th><td><%=rs("Postcode")%></td></tr>
<tr><th>Tel Number</th><td><%=rs("TelNumber")%></td></tr>
<tr><th>Mob Number</th><td><%=rs("MobNumber")%></td></tr>
</table><br>
<%
rs.MoveNext
Wend
end if
rs.close
conn.close
%>
</body>
</html>
I know that intcustomersearch is coming to the right number, because i have tested it with response.write
Any ideas?