473,416 Members | 1,623 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

include file levels??

I have 3 asp pages that look sort of like this:

default.asp:
<%@ Language=VBScript %>
<!--#include file="ExecuteSQL.asp"-->
<html>
....
<tr><td><!--#include File="login.asp"--></td></tr>
....
</html>

login.asp:
<%
dim SQL, rs
SQL = "select * from [user] where..."
rs = GetData(SQL) 'this function is in ExecuteSQL.asp
....
%>
....

ExecuteSQL.asp:
<%
Public Function GetData(SQL)
set objRec = server.CreateObject("adodb.recordset")
objRec.Open SQL,objCon
End Function
%>

The problem is that if I include "ExecuteSQL.asp" directly into the
Login.asp page that invokes the function it works fine. When I move
the include ExecuteSQL.asp to the parent file - Default.asp - it
returns a type mismatch (which I have deduced really means it doesn't
know what the heck GetData is).

I can move the include statement into Login.asp, but I have more
includes of other ASP files in default.asp and it won't let me include
ExecuteSQL.asp in each of them.

Is there an easy way around this?

Sep 6 '07 #1
1 1653
On Sep 6, 2:27 pm, rich <rwal...@integratec.bizwrote:

crud! I understand what's going on now that I better understand 2
things:
1) the includes go first - period. so all code is brought together
before any interpretation of the ASP code
2) the code is processed server-side and does not exist once it is
rendered as HTML to the client

So, my problem (when the include ExecuteSQL.asp was in the Default.asp
page) was that when I tried to logon using login.asp, it submitted
only the login.asp page which no longer had access to the functions in
ExecuteSQL.asp which was included only upon loading Default.asp. The
submit did not reload Default.asp, this no GetData function.

If I put the include ExecuteSQL.asp in the Login.asp file it worked
there, but once logged in that page was gone never to return and thus
my other ASP pages would never have access to functions in a file
included in login.asp

DUH! Hopefully, someone can learn from my mistake.

Sep 6 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Thomas Mlynarczyk | last post by:
Hello, I want to include an inc file into a number of files residing in different directories and different directory levels. Apart from setting include_path accordingly, isn't there a simple...
2
by: Greg | last post by:
I'm new to html and web coding, this is a simple one - appreciate your help! I'm attempting to get my browser bar links to reside in a single .asp file to avoid multiple additions to pages when...
2
by: MDW | last post by:
I’ve got a menu file that’s saved as an .shtml document. I don’t want to post the code, but essentially it’s a simple HTML table, with an XSL template wrapped around it. This way, I can...
2
by: \A_Michigan_User\ | last post by:
Ok, I give up. I need to #include the same 1 file (IncludeThis.asp) into 3 different asp files. 1> C:\MyDir\ThisFile.asp 2> D:\MyDir\AASubSub\ThatFile.asp 3>...
0
by: Andrew_Hoffman | last post by:
Hi there. Im working on a project that deals with multiple levels of list managment. Im getting the ol' 'error C2501' that is caused by missing storage class or type specifiers. I have a source...
2
by: jmcmejl | last post by:
Hi I have a question regarding including an xml file into another. I have googled and found this: Mainfile.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE adocname> <arootnode>...
19
by: SteveT | last post by:
Is it possible to have an include file that resides outside of the web site parent folder? For instance, lets say you have several websites under Inetpub/global/websites/ but the include file is...
7
by: berkshire | last post by:
We recently upgraded php from 4.3.9 to 4.4.7. Everything is working well, except the php scripts running as cronjobs. It appears the problem is that these scripts utilize the include() function...
3
by: vippstar | last post by:
Is this a valid implementation of stdio.h? -- stdio.h -- #ifndef __STDIO_H #define __STDIO_H /* all the necessary declarations etc */ void __dummy(void); void __dummy(void) { return;...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.