Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Braces, Includes and ASP


Message #1 by "Dr John Donovan" <jdonovan@i...> on Fri, 28 Jun 2002 12:56:45
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],[Equipment],[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%>&txtSearchField=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