when i am retriving the records from sqlserver2005 by using ASP.The folloying error is coming
Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/MyWeb/student_db_new.asp, line 21, column 10
foreach x In rs.Fields
---------^
my code is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><title> ADO-List DatabaseRecords</title></head>
<body>
<%
Dim conn,rs,x
Set conn=Server.CreateObject("ADODB.Connection")
conn.provider="Microsoft.Jet.OLEDB.4.O"
conn.open(Server.mappath("db/Student"))
Set rs=Server.CreateObject("ADODB.RecordSet")
rs.open "select*from tblClass",conn
%>
<h2>List Database Table</h2>
<p> Click on a button to modify a record </p>
<table border="1" width="100%">
<tr bgcolor="#b0c4de">
<%
For Each x In rs.Fields
response.write("<th>" &UCase(x.name) &"</th>")
rs.MoveNext
%>
</tr>
<% Do Until rs.EOF %>
<tr bgcolor="f0f0f0">
<form method="post" action="Student_db_edit.asp" target="_blank">
<%
For Each x In rs.Fields
If x.name="studentID" Then %>
<td> <input type="submit" name="studentID" value="<%x.value%>"></td>
<% Else %>
<td> <%respone.Write(x.value)%></td>
<% End If Next %>
</ form >
<rs.MoveNext%>
</tr>
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</table>
</body>
</html>
please tell me where do i mistake