Easy A
Would you like to react to this message? Create an account in a few clicks or log in to continue.


 
HomeHome  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  

Share
 

 Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement

View previous topic View next topic Go down 
AuthorMessage
Dubstep
Member
Member
avatar

Posts : 9
Join date : 2011-03-09

Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement Empty
PostSubject: Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement   Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement EmptySat Dec 10, 2011 4:03 am

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
Back to top Go down
CodeX
Member
Member
CodeX

Posts : 5
Join date : 2011-06-16

Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement Empty
PostSubject: Re: Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement   Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement EmptySat Dec 10, 2011 4:03 am

You must put a SPACE between FOR and EACH.
Code:

For Each x In rs.Fields
In the code you show, you have a space there. But the error message clearly is saying there is no space, so check your code again.
Back to top Go down
Dubstep
Member
Member
avatar

Posts : 9
Join date : 2011-03-09

Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement Empty
PostSubject: Re: Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement   Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement EmptySat Dec 10, 2011 4:04 am

could you show my code i already provide the space between for each
Back to top Go down
CodeX
Member
Member
CodeX

Posts : 5
Join date : 2011-06-16

Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement Empty
PostSubject: Re: Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement   Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement EmptySat Dec 10, 2011 4:05 am

Yes, I *DO* see the space in your code.

But the ERROR MESSAGE you showed does *NOT* have the space there.

Maybe you are trying to run an OLD version of your code?

When I used
Code:

foreach x In rs.Fields

(no space) in a test, I *did* get the same message you got.

Make sure you are running the latest version of your code.
Back to top Go down
Sponsored content




Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement Empty
PostSubject: Re: Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement   Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement Empty

Back to top Go down
 

Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement

View previous topic View next topic Back to top 
Page 1 of 1

 Similar topics

-
» New Microsoft Logo
» Object Error... Why????
» Error in rails gem installation
» recordset error in loop
» w3c validation - please help correcting the error

Permissions in this forum:You cannot reply to topics in this forum
Easy A :: Error Type:Microsoft VBScript compilation (0x800A0401)Expected end of statement Edit-trash Useless :: Trash-