I'm new to ASP and ahve tried to setup a webpage that will search an MS Access database and display the results accordingly.
I have setup up a connection to the database and a recordset stating what information is to be shown and in what order etc.
I have setup a simple form with a search field but when submit is clicked i get a message:
The website cannot display the page
HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.
I ahve been assured that the server I am using has been updated so ASP can be used.
Just in case anyone is interested here is the code so far.
code of searchpage:
Code of ASP page
I have setup up a connection to the database and a recordset stating what information is to be shown and in what order etc.
I have setup a simple form with a search field but when submit is clicked i get a message:
The website cannot display the page
HTTP 500
Most likely causes:
The website is under maintenance.
The website has a programming error.
I ahve been assured that the server I am using has been updated so ASP can be used.
Just in case anyone is interested here is the code so far.
code of searchpage:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body leftmargin="0" topmargin="0">
<table width="580" height="402" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><form id="form1" name="form1" method="post" action="impamembers.asp">
<label>Search
<input type="text" name="textfield" />
</label>
<input type="submit" name="Submit" value="Submit" />
</form> <label></label></td>
</tr>
</table>
</body>
</html>
Code of ASP page
Code:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/impa.asp" -->
<%
var rsMembers__MMColParam = "1";
if (String(Request.QueryString("Company")) != "undefined" &&
String(Request.QueryString("Company")) != "") {
rsMembers__MMColParam = String(Request.QueryString("Company"));
}
%>
<%
var rsMembers = Server.CreateObject("ADODB.Recordset");
rsMembers.ActiveConnection = MM_impa_STRING;
rsMembers.Source = "SELECT * FROM [IMPA Membership Database] WHERE Company LIKE '%"+ rsMembers__MMColParam.replace(/'/g, "''") + "%' ORDER BY Company ASC";
rsMembers.CursorType = 0;
rsMembers.CursorLocation = 2;
rsMembers.LockType = 1;
rsMembers.Open();
var rsMembers_numRows = 0;
%>
<%
var Repeat1__numRows = 10;
var Repeat1__index = 0;
rsMembers_numRows += Repeat1__numRows;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body leftmargin="0" topmargin="0">
<% while ((Repeat1__numRows-- != 0) && (!rsMembers.EOF)) { %>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="136">Company:</td>
<td width="364"><%=(rsMembers.Fields.Item("Company").Value)%></td>
</tr>
<tr>
<td>Name:</td>
<td><%=(rsMembers.Fields.Item("Contact").Value)%></td>
</tr>
<tr>
<td>Country:</td>
<td><%=(rsMembers.Fields.Item("Country").Value)%></td>
</tr>
<tr>
<td>Tel:</td>
<td><%=(rsMembers.Fields.Item("Tel").Value)%></td>
</tr>
<tr>
<td>Fax:</td>
<td><%=(rsMembers.Fields.Item("Fax").Value)%></td>
</tr>
<tr>
<td>Website:</td>
<td><%=(rsMembers.Fields.Item("website").Value)%></td>
</tr>
<tr>
<td>Membership:</td>
<td><%=(rsMembers.Fields.Item("Membership").Value)%></td>
</tr>
<tr>
<td>Profile:</td>
<td> </td>
</tr>
</table>
<%
Repeat1__index++;
rsMembers.MoveNext();
}
%>
</body>
</html>
<%
rsMembers.Close();
%>