Dear Friends
Hi
I am new to this forum...
But with a problem...
I am unable to show the output of a seach below the form.
I have made two pages One for the form and another for the Qeary and output and connected but unable to show the output below d form..
I am writing the code below
Form page:
<html>
<body>
<table align="center" height="50%" cellspacing="2%">
<tr ><td colspan=3 align="center"><h3><u>CONTACT</u></h3></td></tr>
<form method="post" action="process.asp">
<tr><td>CompanyName</td><td><input type="text" name="Companyname"></td></tr>
<tr><td>ContactName</td><td><input type="text" name="Contactname"></td></tr>
<tr><td>Country</td><td><input type="text" name="country"></td></tr>
<tr><td colspan=3 align="center"><input type="submit" value="Search"></td></tr>
</table>
</form>
</body>
</html>
Asp page:
<%
company=Request.Form("companyname")
contact=Request.Form("contactname")
countri=Request.Form("country")
cheak=company+contact+countri
Blank=""
If cheak = Blank Then
Response.Write("All the fields are Blank")
Else
%>
<html>
<body>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.provider="Microsoft.jet.OLEDB.4.0"
conn.open "c:/amit/database/northwind.mdb"
set rs=Server.CreateObject("ADODB.recordset")
If company+contact="" Then
sql="SELECT Companyname, Contactname, Country FROM Customers WHERE country LIKE '"&countri&"'"
Else
sql="SELECT Companyname, Contactname, Country FROM Customers WHERE (companyname LIKE '"&company&"' OR contactname LIKE '"&contact&"')"
End IF
rs.open sql,conn
%>
<table border="1" width="100%" valign="bottom" cellpadding="0" Cellspacing="5" bgcolor="#boc4de">
<tr align="left" bgcolor="7fff00">
<%For Each x in rs.fields%>
<td><%Response.Write(X.name)%></td>
<%Next%>
</tr>
<%
I=1
Do until rs.EOF
a=I mod 2
If a=0 Then
%>
<tr align="left" bgcolor="00ffff">
<%for each x in rs.fields%>
<td><% Response.Write(X.value)%></td>
<%Next%>
</tr>
<%Else%>
<tr align="left" bgcolor="ffff00">
<%for each x in rs.fields%>
<td><% Response.Write(X.value)%></td>
<%Next%>
</tr>
<%
End If
I=I+1
rs.MoveNext
Loop
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
</table>
</body>
</html>
<%End if%>
If anyone can help me i would be greatful to him/her.
Waiting for ur reply