|
 |
asp_databases thread: End..... loop????ERROR
Message #1 by "Locke, Darrell (FCS/SFC)" <Darrell.Locke@g...> on Fri, 11 Oct 2002 10:05:13 -0300
|
|
Hi guys......can some pin point why I am getting this error. Or have any
suggestions.
Here is the code.
Do Until RSEventNames.eof
%>
<OPTION Value="<% Response.Write RSEventNames("EventID") %>">
<% Response.Write RSEventNames("EventName") %></OPTION>
<%
RSEventNames.Movenext
loop <------line 102
%>
Here is the error
Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/calendar/calendar.asp, line 102
THANKS IN ADVANCE PEOPLE
DARRELL
Message #2 by imran.saleem@b... on Fri, 11 Oct 2002 14:14:29 +0100
|
|
show us the whole code you may have a another statement thats not being
ended
-----Original Message-----
From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]
Sent: Friday, October 11, 2002 2:05 PM
To: ASP Databases
Subject: [asp_databases] End..... loop????ERROR
Hi guys......can some pin point why I am getting this error. Or have any
suggestions.
Here is the code.
Do Until RSEventNames.eof
%>
<OPTION Value="<% Response.Write RSEventNames("EventID") %>">
<% Response.Write RSEventNames("EventName") %></OPTION>
<%
RSEventNames.Movenext
loop <------line 102
%>
Here is the error
Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/calendar/calendar.asp, line 102
THANKS IN ADVANCE PEOPLE
DARRELL
Message #3 by "Meinken, Joe" <Joe.Meinken@q...> on Fri, 11 Oct 2002 08:13:53 -0500
|
|
Try:
<%
do until RSEventNames.eof %>
<option> <%=RSEventNames(0)%> </option>
<%
RSEventNames.movenext
loop
%>
-----Original Message-----
From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]
Sent: Friday, October 11, 2002 8:05 AM
To: ASP Databases
Subject: [asp_databases] End..... loop????ERROR
Hi guys......can some pin point why I am getting this error. Or have any
suggestions.
Here is the code.
Do Until RSEventNames.eof
%>
<OPTION Value="<% Response.Write RSEventNames("EventID") %>">
<% Response.Write RSEventNames("EventName") %></OPTION>
<%
RSEventNames.Movenext
loop <------line 102
%>
Here is the error
Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/calendar/calendar.asp, line 102
THANKS IN ADVANCE PEOPLE
DARRELL
Message #4 by "Locke, Darrell (FCS/SFC)" <Darrell.Locke@g...> on Fri, 11 Oct 2002 11:34:00 -0300
|
|
Here is the entire code.
<%@ Language=VBScript %>
<% 'Connection to Datebase
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.Mappath("calendar.mdb")
'Main IF statement, determines what state we are in
If NOT IsEmpty(Request.Form("Changedate")) Then
If IsDate(Request.Form ("GoToDate")) Then
DateInUse = Request.Form ("GoToDate")
Else
DateInUse = Date()
END IF
Elseif not IsEmpty(Request.Form("Add")) Then
if Isdate(Request.Form("Time")) then
'Inserts the data into the database
conn.Execute "INSERT INTO I1OnlineCalendarEvents (EventDate, "_
& "EventTime, EventName, EventDescription, EmpID) Values ( "_
& "'" & Request.Form("CurrentDate") & "', "_
& "'" & Request.Form("Event") & "', "_
& "'" & Request.Form("Description") & "', "_
& "'" & Request.Form("EmpID") & ")"
DateInUse = Request.Form("CurrentDate")
elseif not IsEmpty(Request.Form("Remove")) then
conn.Execute "delete from I1OnlineCalendarEvents where " _
& "EventID = " & Request.Form ("EventID")
DateInUse = Request.Form("CurrentDate")
DateInUse = date()
Set RSEvents = conn.Execute ("SELECT
I1OnLineCalendarEvents.EventsTime, " _
& "I1OnlineCalendarEvents.EventName, "_
& "I1OnlineCalendarEvents.EventDescription, "_
& "I1OnlineCalendarEmps.EmpName,ITOnlineCalendarEmps.EmpMailAddress
"_
& "FROM I1OnlineCalendarEvents INNNER JOIN I1OnlineCalndarEmps ON "
_
& "I1OnlineCalendarEvents.EmpID = I1OnlineCalendarEmps.EmpID " _
& "WHERE I1OnlineCalendarEvents.EventsDate = '" & DateInUse & " '")
Set RSEmps = conn.Execute("SELECT EmpID, EmpName FROM I1Online
CalendarEmps")
Set RSEventsNames = Conn.Execute("SELECT EventID, EventsName FROM "
_
& "I1OnlineCalendarEvents " _
& "WHERE EventsDate = '" & DateInUse & "'")
%>
<HTML>
<HEAD>
<TITLE>FCS Events Calendar</TITLE>
</HEAD>
<BODY>
<% Response.Write DateInUse %>
<Input TYPE=HIDDEN NAME="CurrentDate" Value= "<% Response.Write DateInUse
%>">
<% Do Until RSEvents.EOF %>
<Table>
<tr>
<td><p><% Response.Write formatdatetime (RSEvents ("EventTime"),3)
%> </td>
<td><p><% Response.Write RSEvents("EventName") %></td>
<td><p><% Response.Write RSEvents("EventDescription") %></td>
<td><p><A HREF="<%Response.Write RSEvents("empEmailAddress")%>">
<%Response.Write("EmpName") %></A></TD>
</tr>
<%
RSEvents.Movenext
loop
%>
<% Do until RSEmps.Eof %>
<OPTION Value="<% Response.Write RSemps("EmpID") %>">
<% Response.Write RSEmps("EmpName") %></OPTION>
<%
RsEmps.Movenext
loop
%>
<%
Do Until RSEventNames.eof
%>
<OPTION Value="<% Response.Write RSEventNames("EventID") %>">
<% Response.Write RSEventNames("EventName") %></OPTION>
<%
RSEventNames.Movenext
loop
%>
RSEventNames.Close
Set RSEventNames = Nothing
</Table>
</BODY>
</HTML>
-----Original Message-----
From: imran.saleem@b... [mailto:imran.saleem@b...]
Sent: October 11, 2002 10:14 AM
To: ASP Databases
Subject: [asp_databases] RE: End..... loop????ERROR
show us the whole code you may have a another statement thats not being
ended
-----Original Message-----
From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]
Sent: Friday, October 11, 2002 2:05 PM
To: ASP Databases
Subject: [asp_databases] End..... loop????ERROR
Hi guys......can some pin point why I am getting this error. Or have any
suggestions.
Here is the code.
Do Until RSEventNames.eof
%>
<OPTION Value="<% Response.Write RSEventNames("EventID") %>">
<% Response.Write RSEventNames("EventName") %></OPTION>
<%
RSEventNames.Movenext
loop <------line 102
%>
Here is the error
Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/calendar/calendar.asp, line 102
THANKS IN ADVANCE PEOPLE
DARRELL
Message #5 by "Meinken, Joe" <Joe.Meinken@q...> on Fri, 11 Oct 2002 09:53:30 -0500
|
|
I don't know whether the paste of your code into this email re-indented
everything, but try cleaning up the indentation and you'll see where the
missing END IFs go.
-----Original Message-----
From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]
Sent: Friday, October 11, 2002 9:34 AM
To: ASP Databases
Subject: [asp_databases] RE: End..... loop????ERROR
Here is the entire code.
<%@ Language=VBScript %>
<% 'Connection to Datebase
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.Mappath("calendar.mdb")
'Main IF statement, determines what state we are in
If NOT IsEmpty(Request.Form("Changedate")) Then
If IsDate(Request.Form ("GoToDate")) Then
DateInUse = Request.Form ("GoToDate")
Else
DateInUse = Date()
END IF
Elseif not IsEmpty(Request.Form("Add")) Then
if Isdate(Request.Form("Time")) then
'Inserts the data into the database
conn.Execute "INSERT INTO I1OnlineCalendarEvents (EventDate, "_
& "EventTime, EventName, EventDescription, EmpID) Values ( "_
& "'" & Request.Form("CurrentDate") & "', "_
& "'" & Request.Form("Event") & "', "_
& "'" & Request.Form("Description") & "', "_
& "'" & Request.Form("EmpID") & ")"
DateInUse = Request.Form("CurrentDate")
elseif not IsEmpty(Request.Form("Remove")) then
conn.Execute "delete from I1OnlineCalendarEvents where " _
& "EventID = " & Request.Form ("EventID")
DateInUse = Request.Form("CurrentDate")
DateInUse = date()
Set RSEvents = conn.Execute ("SELECT
I1OnLineCalendarEvents.EventsTime, " _
& "I1OnlineCalendarEvents.EventName, "_
& "I1OnlineCalendarEvents.EventDescription, "_
& "I1OnlineCalendarEmps.EmpName,ITOnlineCalendarEmps.EmpMailAddress
"_
& "FROM I1OnlineCalendarEvents INNNER JOIN I1OnlineCalndarEmps ON "
_
& "I1OnlineCalendarEvents.EmpID = I1OnlineCalendarEmps.EmpID " _
& "WHERE I1OnlineCalendarEvents.EventsDate = '" & DateInUse & " '")
Set RSEmps = conn.Execute("SELECT EmpID, EmpName FROM I1Online
CalendarEmps")
Set RSEventsNames = Conn.Execute("SELECT EventID, EventsName FROM "
_
& "I1OnlineCalendarEvents " _
& "WHERE EventsDate = '" & DateInUse & "'")
%>
<HTML>
<HEAD>
<TITLE>FCS Events Calendar</TITLE>
</HEAD>
<BODY>
<% Response.Write DateInUse %>
<Input TYPE=HIDDEN NAME="CurrentDate" Value= "<% Response.Write DateInUse
%>">
<% Do Until RSEvents.EOF %>
<Table>
<tr>
<td><p><% Response.Write formatdatetime (RSEvents ("EventTime"),3)
%> </td>
<td><p><% Response.Write RSEvents("EventName") %></td>
<td><p><% Response.Write RSEvents("EventDescription") %></td>
<td><p><A HREF="<%Response.Write RSEvents("empEmailAddress")%>">
<%Response.Write("EmpName") %></A></TD>
</tr>
<%
RSEvents.Movenext
loop
%>
<% Do until RSEmps.Eof %>
<OPTION Value="<% Response.Write RSemps("EmpID") %>">
<% Response.Write RSEmps("EmpName") %></OPTION>
<%
RsEmps.Movenext
loop
%>
<%
Do Until RSEventNames.eof
%>
<OPTION Value="<% Response.Write RSEventNames("EventID") %>">
<% Response.Write RSEventNames("EventName") %></OPTION>
<%
RSEventNames.Movenext
loop
%>
RSEventNames.Close
Set RSEventNames = Nothing
</Table>
</BODY>
</HTML>
-----Original Message-----
From: imran.saleem@b... [mailto:imran.saleem@b...]
Sent: October 11, 2002 10:14 AM
To: ASP Databases
Subject: [asp_databases] RE: End..... loop????ERROR
show us the whole code you may have a another statement thats not being
ended
-----Original Message-----
From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]
Sent: Friday, October 11, 2002 2:05 PM
To: ASP Databases
Subject: [asp_databases] End..... loop????ERROR
Hi guys......can some pin point why I am getting this error. Or have any
suggestions.
Here is the code.
Do Until RSEventNames.eof
%>
<OPTION Value="<% Response.Write RSEventNames("EventID") %>">
<% Response.Write RSEventNames("EventName") %></OPTION>
<%
RSEventNames.Movenext
loop <------line 102
%>
Here is the error
Error Type:
Microsoft VBScript compilation (0x800A03F6)
Expected 'End'
/calendar/calendar.asp, line 102
THANKS IN ADVANCE PEOPLE
DARRELL
Message #6 by "Peter Foti (PeterF)" <PeterF@S...> on Fri, 11 Oct 2002 11:27:40 -0400
|
|
Joe is correct. After indenting your code more properly, the mistakes are
clearly seen. You are missing 2 End statements. Below is the corrected
code.
Also, it is inefficient to repeatedly switch between ASP tags and HTML tags
(opening and closing ASP tags). You might instead use Response.Write to
write some of your HTML tags. Example:
Change this...
<% Do Until RSEvents.EOF %>
<Table>
<tr>
<td><p><% Response.Write formatdatetime (RSEvents ("EventTime"),3)
%> </td>
<td><p><% Response.Write RSEvents("EventName") %></td>
<td><p><% Response.Write RSEvents("EventDescription") %></td>
<td><p><A HREF="<%Response.Write RSEvents("empEmailAddress")%>">
<%Response.Write("EmpName") %></A></TD>
</tr>
<%
RSEvents.Movenext
loop
%>
To this...
<Table>
<%
Do Until RSEvents.EOF
Response.Write "<tr>"
Response.Write " <td><p>"
Response.Write formatdatetime(RSEvents ("EventTime"),3)
Response.Write " </td>"
Response.Write " <td><p>"
Response.Write RSEvents("EventName")
Response.Write " </td>"
Response.Write " <td><p>"
Response.Write RSEvents("EventDescription")
Response.Write " </td>"
Response.Write "<td><p><A HREF="""
Response.Write RSEvents("empEmailAddress")
Response.Write """>"
Response.Write RSEvents("EmpName")
Response.Write "</A></TD>"
Response.Write "</tr>"
RSEvents.Movenext
loop
%>
</table>
One last thing. You are generating invalid HTML code. For example, you did
not include a closing table tag before you start writing OPTION tags. You
should consider using the HTML Validator available at www.w3.org. It's very
useful. Note that I have not corrected any of the HTML errors below
(missing tags or what not), I have only shown you where you need to place
End statements.
Regards,
Peter
<%@ Language=VBScript %>
<% 'Connection to Datebase
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.Mappath("calendar.mdb")
'Main IF statement, determines what state we are in
If NOT IsEmpty(Request.Form("Changedate")) Then
If IsDate(Request.Form ("GoToDate")) Then
DateInUse = Request.Form ("GoToDate")
Else
DateInUse = Date()
END IF
Elseif not IsEmpty(Request.Form("Add")) Then
if Isdate(Request.Form("Time")) then
'Inserts the data into the database
conn.Execute "INSERT INTO I1OnlineCalendarEvents (EventDate, "_
& "EventTime, EventName, EventDescription, EmpID) Values ( "_
& "'" & Request.Form("CurrentDate") & "', "_
& "'" & Request.Form("Event") & "', "_
& "'" & Request.Form("Description") & "', "_
& "'" & Request.Form("EmpID") & ")"
DateInUse = Request.Form("CurrentDate")
elseif not IsEmpty(Request.Form("Remove")) then
conn.Execute "delete from I1OnlineCalendarEvents where " _
& "EventID = " & Request.Form ("EventID")
DateInUse = Request.Form("CurrentDate")
DateInUse = date()
Set RSEvents = conn.Execute ("SELECT
I1OnLineCalendarEvents.EventsTime, " _
& "I1OnlineCalendarEvents.EventName, "_
& "I1OnlineCalendarEvents.EventDescription, "_
& "I1OnlineCalendarEmps.EmpName,ITOnlineCalendarEmps.EmpMailAddress
"_
& "FROM I1OnlineCalendarEvents INNNER JOIN I1OnlineCalndarEmps ON "
_
& "I1OnlineCalendarEvents.EmpID = I1OnlineCalendarEmps.EmpID " _
& "WHERE I1OnlineCalendarEvents.EventsDate = '" & DateInUse & " '")
Set RSEmps = conn.Execute("SELECT EmpID, EmpName FROM I1Online
CalendarEmps")
Set RSEventsNames = Conn.Execute("SELECT EventID, EventsName FROM "
_
& "I1OnlineCalendarEvents " _
& "WHERE EventsDate = '" & DateInUse & "'")
' *********************************************
' MISSING END HERE
' *********************************************
End
' *********************************************
' MISSING END HERE
' *********************************************
End
%>
<HTML>
<HEAD>
<TITLE>FCS Events Calendar</TITLE>
</HEAD>
<BODY>
<% Response.Write DateInUse %>
<Input TYPE=HIDDEN NAME="CurrentDate" Value= "<% Response.Write DateInUse
%>">
<% Do Until RSEvents.EOF %>
<Table>
<tr>
<td><p><% Response.Write formatdatetime (RSEvents ("EventTime"),3)
%> </td>
<td><p><% Response.Write RSEvents("EventName") %></td>
<td><p><% Response.Write RSEvents("EventDescription") %></td>
<td><p><A HREF="<%Response.Write RSEvents("empEmailAddress")%>">
<%Response.Write("EmpName") %></A></TD>
</tr>
<%
RSEvents.Movenext
loop
%>
<% Do until RSEmps.Eof %>
<OPTION Value="<% Response.Write RSemps("EmpID") %>">
<% Response.Write RSEmps("EmpName") %></OPTION>
<%
RsEmps.Movenext
loop
%>
<%
Do Until RSEventNames.eof
%>
<OPTION Value="<% Response.Write RSEventNames("EventID") %>">
<% Response.Write RSEventNames("EventName") %></OPTION>
<%
RSEventNames.Movenext
loop
%>
RSEventNames.Close
Set RSEventNames = Nothing
</Table>
</BODY>
</HTML>
> -----Original Message-----
> From: Meinken, Joe [mailto:Joe.Meinken@q...]
> Sent: Friday, October 11, 2002 10:54 AM
> To: ASP Databases
> Subject: [asp_databases] RE: End..... loop????ERROR
>
>
> I don't know whether the paste of your code into this email
> re-indented
> everything, but try cleaning up the indentation and you'll
> see where the
> missing END IFs go.
>
>
>
> -----Original Message-----
> From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]
> Sent: Friday, October 11, 2002 9:34 AM
> To: ASP Databases
> Subject: [asp_databases] RE: End..... loop????ERROR
>
>
> Here is the entire code.
>
> <%@ Language=VBScript %>
>
> <% 'Connection to Datebase
> Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=" & Server.Mappath("calendar.mdb")
>
> 'Main IF statement, determines what state we are in
> If NOT IsEmpty(Request.Form("Changedate")) Then
> If IsDate(Request.Form ("GoToDate")) Then
> DateInUse = Request.Form ("GoToDate")
> Else
> DateInUse = Date()
> END IF
>
> Elseif not IsEmpty(Request.Form("Add")) Then
> if Isdate(Request.Form("Time")) then
>
>
> 'Inserts the data into the database
> conn.Execute "INSERT INTO I1OnlineCalendarEvents (EventDate, "_
> & "EventTime, EventName, EventDescription, EmpID) Values ( "_
> & "'" & Request.Form("CurrentDate") & "', "_
> & "'" & Request.Form("Event") & "', "_
> & "'" & Request.Form("Description") & "', "_
> & "'" & Request.Form("EmpID") & ")"
>
> DateInUse = Request.Form("CurrentDate")
>
> elseif not IsEmpty(Request.Form("Remove")) then
>
> conn.Execute "delete from I1OnlineCalendarEvents where " _
> & "EventID = " & Request.Form ("EventID")
>
> DateInUse = Request.Form("CurrentDate")
> DateInUse = date()
>
> Set RSEvents = conn.Execute ("SELECT
> I1OnLineCalendarEvents.EventsTime, " _
> & "I1OnlineCalendarEvents.EventName, "_
> & "I1OnlineCalendarEvents.EventDescription, "_
> &
> "I1OnlineCalendarEmps.EmpName,ITOnlineCalendarEmps.EmpMailAddress
> "_
> & "FROM I1OnlineCalendarEvents INNNER JOIN
> I1OnlineCalndarEmps ON "
> _
> & "I1OnlineCalendarEvents.EmpID = I1OnlineCalendarEmps.EmpID " _
> & "WHERE I1OnlineCalendarEvents.EventsDate = '" &
> DateInUse & " '")
>
> Set RSEmps = conn.Execute("SELECT EmpID, EmpName FROM I1Online
> CalendarEmps")
> Set RSEventsNames = Conn.Execute("SELECT EventID,
> EventsName FROM "
> _
> & "I1OnlineCalendarEvents " _
> & "WHERE EventsDate = '" & DateInUse & "'")
>
> %>
>
> <HTML>
> <HEAD>
> <TITLE>FCS Events Calendar</TITLE>
> </HEAD>
>
> <BODY>
>
>
>
> <% Response.Write DateInUse %>
>
> <Input TYPE=HIDDEN NAME="CurrentDate" Value= "<%
> Response.Write DateInUse
> %>">
>
>
> <% Do Until RSEvents.EOF %>
> <Table>
> <tr>
> <td><p><% Response.Write formatdatetime (RSEvents
> ("EventTime"),3)
> %> </td>
> <td><p><% Response.Write RSEvents("EventName") %></td>
> <td><p><% Response.Write RSEvents("EventDescription") %></td>
> <td><p><A HREF="<%Response.Write RSEvents("empEmailAddress")%>">
> <%Response.Write("EmpName") %></A></TD>
>
> </tr>
> <%
> RSEvents.Movenext
> loop
>
> %>
>
> <% Do until RSEmps.Eof %>
> <OPTION Value="<% Response.Write RSemps("EmpID") %>">
> <% Response.Write RSEmps("EmpName") %></OPTION>
>
> <%
> RsEmps.Movenext
> loop
>
> %>
>
> <%
>
> Do Until RSEventNames.eof
> %>
>
> <OPTION Value="<% Response.Write RSEventNames("EventID") %>">
> <% Response.Write RSEventNames("EventName") %></OPTION>
>
> <%
> RSEventNames.Movenext
> loop
>
> %>
>
>
> RSEventNames.Close
> Set RSEventNames = Nothing
> </Table>
>
>
> </BODY>
> </HTML>
>
> -----Original Message-----
> From: imran.saleem@b... [mailto:imran.saleem@b...]
> Sent: October 11, 2002 10:14 AM
> To: ASP Databases
> Subject: [asp_databases] RE: End..... loop????ERROR
>
> show us the whole code you may have a another statement thats
> not being
> ended
>
> -----Original Message-----
> From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]
> Sent: Friday, October 11, 2002 2:05 PM
> To: ASP Databases
> Subject: [asp_databases] End..... loop????ERROR
>
>
> Hi guys......can some pin point why I am getting this error.
> Or have any
> suggestions.
>
> Here is the code.
>
> Do Until RSEventNames.eof
> %>
>
> <OPTION Value="<% Response.Write RSEventNames("EventID") %>">
> <% Response.Write RSEventNames("EventName") %></OPTION>
>
> <%
> RSEventNames.Movenext
> loop <------line 102
>
> %>
>
> Here is the error
> Error Type:
> Microsoft VBScript compilation (0x800A03F6)
> Expected 'End'
> /calendar/calendar.asp, line 102
>
> THANKS IN ADVANCE PEOPLE
> DARRELL
>
>
>
>
>
Message #7 by "Locke, Darrell (FCS/SFC)" <Darrell.Locke@g...> on Fri, 11 Oct 2002 14:22:58 -0300
|
|
Thanks for the heads up and corrections, yes that is correct, I am missing
the Ends. I found that upon looking over the code. Sorry the other stuff
is missing Ex.</table> I excluded a bunch of stuff cause it was not relative
to the code problem I was running into. I guess I should have added it all.
Hope I never confused you.
Yes the indents were obviously added due to the mail configuration.
Thanks again for all the help here.
D
-----Original Message-----
From: Peter Foti (PeterF) [mailto:PeterF@S...]
Sent: October 11, 2002 12:28 PM
To: ASP Databases
Subject: [asp_databases] RE: End..... loop????ERROR
Joe is correct. After indenting your code more properly, the mistakes are
clearly seen. You are missing 2 End statements. Below is the corrected
code.
Also, it is inefficient to repeatedly switch between ASP tags and HTML tags
(opening and closing ASP tags). You might instead use Response.Write to
write some of your HTML tags. Example:
Change this...
<% Do Until RSEvents.EOF %>
<Table>
<tr>
<td><p><% Response.Write formatdatetime (RSEvents ("EventTime"),3)
%> </td>
<td><p><% Response.Write RSEvents("EventName") %></td>
<td><p><% Response.Write RSEvents("EventDescription") %></td>
<td><p><A HREF="<%Response.Write RSEvents("empEmailAddress")%>">
<%Response.Write("EmpName") %></A></TD>
</tr>
<%
RSEvents.Movenext
loop
%>
To this...
<Table>
<%
Do Until RSEvents.EOF
Response.Write "<tr>"
Response.Write " <td><p>"
Response.Write formatdatetime(RSEvents ("EventTime"),3)
Response.Write " </td>"
Response.Write " <td><p>"
Response.Write RSEvents("EventName")
Response.Write " </td>"
Response.Write " <td><p>"
Response.Write RSEvents("EventDescription")
Response.Write " </td>"
Response.Write "<td><p><A HREF="""
Response.Write RSEvents("empEmailAddress")
Response.Write """>"
Response.Write RSEvents("EmpName")
Response.Write "</A></TD>"
Response.Write "</tr>"
RSEvents.Movenext
loop
%>
</table>
One last thing. You are generating invalid HTML code. For example, you did
not include a closing table tag before you start writing OPTION tags. You
should consider using the HTML Validator available at www.w3.org. It's very
useful. Note that I have not corrected any of the HTML errors below
(missing tags or what not), I have only shown you where you need to place
End statements.
Regards,
Peter
<%@ Language=VBScript %>
<% 'Connection to Datebase
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & Server.Mappath("calendar.mdb")
'Main IF statement, determines what state we are in
If NOT IsEmpty(Request.Form("Changedate")) Then
If IsDate(Request.Form ("GoToDate")) Then
DateInUse = Request.Form ("GoToDate")
Else
DateInUse = Date()
END IF
Elseif not IsEmpty(Request.Form("Add")) Then
if Isdate(Request.Form("Time")) then
'Inserts the data into the database
conn.Execute "INSERT INTO I1OnlineCalendarEvents (EventDate, "_
& "EventTime, EventName, EventDescription, EmpID) Values ( "_
& "'" & Request.Form("CurrentDate") & "', "_
& "'" & Request.Form("Event") & "', "_
& "'" & Request.Form("Description") & "', "_
& "'" & Request.Form("EmpID") & ")"
DateInUse = Request.Form("CurrentDate")
elseif not IsEmpty(Request.Form("Remove")) then
conn.Execute "delete from I1OnlineCalendarEvents where " _
& "EventID = " & Request.Form ("EventID")
DateInUse = Request.Form("CurrentDate")
DateInUse = date()
Set RSEvents = conn.Execute ("SELECT
I1OnLineCalendarEvents.EventsTime, " _
& "I1OnlineCalendarEvents.EventName, "_
& "I1OnlineCalendarEvents.EventDescription, "_
& "I1OnlineCalendarEmps.EmpName,ITOnlineCalendarEmps.EmpMailAddress
"_
& "FROM I1OnlineCalendarEvents INNNER JOIN I1OnlineCalndarEmps ON "
_
& "I1OnlineCalendarEvents.EmpID = I1OnlineCalendarEmps.EmpID " _
& "WHERE I1OnlineCalendarEvents.EventsDate = '" & DateInUse & " '")
Set RSEmps = conn.Execute("SELECT EmpID, EmpName FROM I1Online
CalendarEmps")
Set RSEventsNames = Conn.Execute("SELECT EventID, EventsName FROM "
_
& "I1OnlineCalendarEvents " _
& "WHERE EventsDate = '" & DateInUse & "'")
' *********************************************
' MISSING END HERE
' *********************************************
End
' *********************************************
' MISSING END HERE
' *********************************************
End
%>
<HTML>
<HEAD>
<TITLE>FCS Events Calendar</TITLE>
</HEAD>
<BODY>
<% Response.Write DateInUse %>
<Input TYPE=HIDDEN NAME="CurrentDate" Value= "<% Response.Write DateInUse
%>">
<% Do Until RSEvents.EOF %>
<Table>
<tr>
<td><p><% Response.Write formatdatetime (RSEvents ("EventTime"),3)
%> </td>
<td><p><% Response.Write RSEvents("EventName") %></td>
<td><p><% Response.Write RSEvents("EventDescription") %></td>
<td><p><A HREF="<%Response.Write RSEvents("empEmailAddress")%>">
<%Response.Write("EmpName") %></A></TD>
</tr>
<%
RSEvents.Movenext
loop
%>
<% Do until RSEmps.Eof %>
<OPTION Value="<% Response.Write RSemps("EmpID") %>">
<% Response.Write RSEmps("EmpName") %></OPTION>
<%
RsEmps.Movenext
loop
%>
<%
Do Until RSEventNames.eof
%>
<OPTION Value="<% Response.Write RSEventNames("EventID") %>">
<% Response.Write RSEventNames("EventName") %></OPTION>
<%
RSEventNames.Movenext
loop
%>
RSEventNames.Close
Set RSEventNames = Nothing
</Table>
</BODY>
</HTML>
> -----Original Message-----
> From: Meinken, Joe [mailto:Joe.Meinken@q...]
> Sent: Friday, October 11, 2002 10:54 AM
> To: ASP Databases
> Subject: [asp_databases] RE: End..... loop????ERROR
>
>
> I don't know whether the paste of your code into this email
> re-indented
> everything, but try cleaning up the indentation and you'll
> see where the
> missing END IFs go.
>
>
>
> -----Original Message-----
> From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]
> Sent: Friday, October 11, 2002 9:34 AM
> To: ASP Databases
> Subject: [asp_databases] RE: End..... loop????ERROR
>
>
> Here is the entire code.
>
> <%@ Language=VBScript %>
>
> <% 'Connection to Datebase
> Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
> "Data Source=" & Server.Mappath("calendar.mdb")
>
> 'Main IF statement, determines what state we are in
> If NOT IsEmpty(Request.Form("Changedate")) Then
> If IsDate(Request.Form ("GoToDate")) Then
> DateInUse = Request.Form ("GoToDate")
> Else
> DateInUse = Date()
> END IF
>
> Elseif not IsEmpty(Request.Form("Add")) Then
> if Isdate(Request.Form("Time")) then
>
>
> 'Inserts the data into the database
> conn.Execute "INSERT INTO I1OnlineCalendarEvents (EventDate, "_
> & "EventTime, EventName, EventDescription, EmpID) Values ( "_
> & "'" & Request.Form("CurrentDate") & "', "_
> & "'" & Request.Form("Event") & "', "_
> & "'" & Request.Form("Description") & "', "_
> & "'" & Request.Form("EmpID") & ")"
>
> DateInUse = Request.Form("CurrentDate")
>
> elseif not IsEmpty(Request.Form("Remove")) then
>
> conn.Execute "delete from I1OnlineCalendarEvents where " _
> & "EventID = " & Request.Form ("EventID")
>
> DateInUse = Request.Form("CurrentDate")
> DateInUse = date()
>
> Set RSEvents = conn.Execute ("SELECT
> I1OnLineCalendarEvents.EventsTime, " _
> & "I1OnlineCalendarEvents.EventName, "_
> & "I1OnlineCalendarEvents.EventDescription, "_
> &
> "I1OnlineCalendarEmps.EmpName,ITOnlineCalendarEmps.EmpMailAddress
> "_
> & "FROM I1OnlineCalendarEvents INNNER JOIN
> I1OnlineCalndarEmps ON "
> _
> & "I1OnlineCalendarEvents.EmpID = I1OnlineCalendarEmps.EmpID " _
> & "WHERE I1OnlineCalendarEvents.EventsDate = '" &
> DateInUse & " '")
>
> Set RSEmps = conn.Execute("SELECT EmpID, EmpName FROM I1Online
> CalendarEmps")
> Set RSEventsNames = Conn.Execute("SELECT EventID,
> EventsName FROM "
> _
> & "I1OnlineCalendarEvents " _
> & "WHERE EventsDate = '" & DateInUse & "'")
>
> %>
>
> <HTML>
> <HEAD>
> <TITLE>FCS Events Calendar</TITLE>
> </HEAD>
>
> <BODY>
>
>
>
> <% Response.Write DateInUse %>
>
> <Input TYPE=HIDDEN NAME="CurrentDate" Value= "<%
> Response.Write DateInUse
> %>">
>
>
> <% Do Until RSEvents.EOF %>
> <Table>
> <tr>
> <td><p><% Response.Write formatdatetime (RSEvents
> ("EventTime"),3)
> %> </td>
> <td><p><% Response.Write RSEvents("EventName") %></td>
> <td><p><% Response.Write RSEvents("EventDescription") %></td>
> <td><p><A HREF="<%Response.Write RSEvents("empEmailAddress")%>">
> <%Response.Write("EmpName") %></A></TD>
>
> </tr>
> <%
> RSEvents.Movenext
> loop
>
> %>
>
> <% Do until RSEmps.Eof %>
> <OPTION Value="<% Response.Write RSemps("EmpID") %>">
> <% Response.Write RSEmps("EmpName") %></OPTION>
>
> <%
> RsEmps.Movenext
> loop
>
> %>
>
> <%
>
> Do Until RSEventNames.eof
> %>
>
> <OPTION Value="<% Response.Write RSEventNames("EventID") %>">
> <% Response.Write RSEventNames("EventName") %></OPTION>
>
> <%
> RSEventNames.Movenext
> loop
>
> %>
>
>
> RSEventNames.Close
> Set RSEventNames = Nothing
> </Table>
>
>
> </BODY>
> </HTML>
>
> -----Original Message-----
> From: imran.saleem@b... [mailto:imran.saleem@b...]
> Sent: October 11, 2002 10:14 AM
> To: ASP Databases
> Subject: [asp_databases] RE: End..... loop????ERROR
>
> show us the whole code you may have a another statement thats
> not being
> ended
>
> -----Original Message-----
> From: Locke, Darrell (FCS/SFC) [mailto:Darrell.Locke@g...]
> Sent: Friday, October 11, 2002 2:05 PM
> To: ASP Databases
> Subject: [asp_databases] End..... loop????ERROR
>
>
> Hi guys......can some pin point why I am getting this error.
> Or have any
> suggestions.
>
> Here is the code.
>
> Do Until RSEventNames.eof
> %>
>
> <OPTION Value="<% Response.Write RSEventNames("EventID") %>">
> <% Response.Write RSEventNames("EventName") %></OPTION>
>
> <%
> RSEventNames.Movenext
> loop <------line 102
>
> %>
>
> Here is the error
> Error Type:
> Microsoft VBScript compilation (0x800A03F6)
> Expected 'End'
> /calendar/calendar.asp, line 102
>
> THANKS IN ADVANCE PEOPLE
> DARRELL
>
>
>
>
>
|
|
 |