Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Re: Braces, Includes and ASP


Message #1 by "Ken Schaefer" <ken@a...> on Mon, 1 Jul 2002 15:13:52 +1000
Please post the include file.

The file below has matching braces. The fact that you get no error when you
have no include file would indicate that there is an opening brace in the
include file that is not matched anywhere. The run-time parser gets to the
end of the page, and finds no matching closing brace, and then throws an
exception pointing to the last line of your code.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Dr John Donovan" <jdonovan@i...>
Subject: [access_asp] Braces, Includes and ASP


: Hello,
:
:
:  I have a page, index.asp, in which I have a line - <!--#include
file="scripts/dbscripts.inc"-->.
: As it happens at the moment, index.asp does not call any functions within
this file (but I hope
: it will) If I browse to index.asp with the 'include line' I get an error
:
: Microsoft JScript compilation error '800a03f1'
: Expected '}'
: /Research_Funding/index.asp, line 80
:
: Note:- The line 'adoConnection = null;' is line 80 in the original and is
the last line in the code
: below.
:
: However, I can find no instances of unmatched braces in either the
index.asp file or the inc file.
: If I include the '}' only the bottom half of the index.asp page displays
(This half is outside the
: final %> and is all just notmal HTML). This seems to be very odd
behaviour.
:
: On the other hand, if I leave out the 'include line' I get no error.
:
: Code is below.
: <%@ Language = JavaScript %>
:
: <%
: //Setting up the connections to generate the reports
: var adoConnection = Server.CreateObject("ADODB.Connection");
: var adoRecordSet;
: var mySQL;
:
: adoConnection.Open("DSN=RFDB");
: mySQL = "SELECT
:
[Record_Number],[Programme],[Closing_Date],[Acronym],[Value_Max],[Staff],[Eq
uipment],[Co
: nsumables],[Travel],[Industry_Partner],[Rolling] FROM Basic ORDER BY
[Closing_Date];";
: adoRecordSet = adoConnection.Execute(mySQL);
: //Page through the database until the last record
: while( adoRecordSet.Eof == false )
: {
: %>
:
: <td><a
:
href="PsearchResult.asp?txtLookUp=<%=adoRecordSet("Record_Number").Value%>">
<%=a
: d
: oRecordSet("Programme").Value%></a></td>
: <td><%=adoRecordSet("Closing_Date").Value%></td>
: <td><%=adoRecordSet("Acronym").Value%></td>
: <td>&euro;<%=adoRecordSet("Value_Max").Value%></td>
: <td align="center"><a
:
href="searchResult.asp?txtLookUp=<%=adoRecordSet("Staff").Value%>&txtSearchF
ield=Staff
: "><%=adoRecordSet("Staff").Value%></a></td>
: <td align="center"><%=adoRecordSet("Equipment").Value%></td>
: <td align="center"><%=adoRecordSet("Consumables").Value%></td>
: <td align="center"><%=adoRecordSet("Travel").Value%></td>
: <td
: align="center"><%=adoRecordSet("Industry_Partner").Value%></td>
: <td align="center"><%=adoRecordSet("Rolling").Value%></td></tr>
:
:
: <%adoRecordSet.MoveNext();
: }
: //Close out Connections and RecordSet and release memory used
: adoRecordSet.Close();
: adoRecordSet = null;
: adoConnection.Close();
: adoConnection = null;
: %>


Message #2 by "Dr John Donovan" <jdonovan@i...> on Mon, 8 Jul 2002 16:31:21
Ken,

On closer inspection... I managed to find a loose brace. Thanks for the help.


> Please post the include file.

The file below has matching braces. The fact that you get no error when you
have no include file would indicate that there is an opening brace in the
include file that is not matched anywhere. The run-time parser gets to the
end of the page, and finds no matching closing brace, and then throws an
exception pointing to the last line of your code.

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Dr John Donovan" <jdonovan@i...>
Subject: [access_asp] Braces, Includes and ASP


: Hello,
:
:
:  I have a page, index.asp, in which I have a line - <!--#include
file="scripts/dbscripts.inc"-->.
: As it happens at the moment, index.asp does not call any functions within
this file (but I hope
: it will) If I browse to index.asp with the 'include line' I get an error
:
: Microsoft JScript compilation error '800a03f1'
: Expected '}'
: /Research_Funding/index.asp, line 80
:
: Note:- The line 'adoConnection = null;' is line 80 in the original and is
the last line in the code
: below.
:
: However, I can find no instances of unmatched braces in either the
index.asp file or the inc file.
: If I include the '}' only the bottom half of the index.asp page displays
(This half is outside the
: final %> and is all just notmal HTML). This seems to be very odd
behaviour.
:
: On the other hand, if I leave out the 'include line' I get no error.
:
: Code is below.
: <%@ Language = JavaScript %>
:
: <%
: //Setting up the connections to generate the reports
: var adoConnection = Server.CreateObject("ADODB.Connection");
: var adoRecordSet;
: var mySQL;
:
: adoConnection.Open("DSN=RFDB");
: mySQL = "SELECT
:
[Record_Number],[Programme],[Closing_Date],[Acronym],[Value_Max],[Staff],[E
q
uipment],[Co
: nsumables],[Travel],[Industry_Partner],[Rolling] FROM Basic ORDER BY
[Closing_Date];";
: adoRecordSet = adoConnection.Execute(mySQL);
: //Page through the database until the last record
: while( adoRecordSet.Eof == false )
: {
: %>
:
: <td><a
:
href="PsearchResult.asp?txtLookUp=<%=adoRecordSet("Record_Number").Value%>"
>
<%=a
: d
: oRecordSet("Programme").Value%></a></td>
: <td><%=adoRecordSet("Closing_Date").Value%></td>
: <td><%=adoRecordSet("Acronym").Value%></td>
: <td>&euro;<%=adoRecordSet("Value_Max").Value%></td>
: <td align="center"><a
:
href="searchResult.asp?txtLookUp=<%=adoRecordSet("Staff").Value%>&txtSearch
F
ield=Staff
: "><%=adoRecordSet("Staff").Value%></a></td>
: <td align="center"><%=adoRecordSet("Equipment").Value%></td>
: <td align="center"><%=adoRecordSet("Consumables").Value%></td>
: <td align="center"><%=adoRecordSet("Travel").Value%></td>
: <td
: align="center"><%=adoRecordSet("Industry_Partner").Value%></td>
: <td align="center"><%=adoRecordSet("Rolling").Value%></td></tr>
:
:
: <%adoRecordSet.MoveNext();
: }
: //Close out Connections and RecordSet and release memory used
: adoRecordSet.Close();
: adoRecordSet = null;
: adoConnection.Close();
: adoConnection = null;
: %>



  Return to Index