|
 |
asp_databases thread: include file
Message #1 by "Carl E. Olsen" <carl-olsen@m...> on Sun, 1 Sep 2002 19:37:23 -0500
|
|
I'm reading "Beginning ASP Databases, ISBN 1-861002-7-26". On pages
208-209, there is an example that uses an "include" file by the name of
"adovbs.inc". When I try to run the example, I get an error message
that says it can't find the adovbs.inc file. When I rename the file
"adovbs.asp" it works just fine. Does anyone know why it will not work
with the ".inc" file extension?
I'm running Visual Studio 6 on Windows XP Professional. The example
uses a Microsoft Access database file by the name of Sailors which can
be downloaded from Wrox.
Carl Olsen, MCSE
Des Moines, Iowa
http://carl-olsen.com/
Message #2 by "Pat Wong" <vinyl-junkie@n...> on Sun, 1 Sep 2002 17:46:53 -0700
|
|
When using an include file, the file extension doesn't matter. In fact,
you can use any kind of file extension you want. When you downloaded the
example from the Wrox website, the include file was probably named
"adovbs.asp" instead of "adovbs.inc" and that's why you got the error.
Sounds to me like they have a misprint in the book.
| I'm reading "Beginning ASP Databases, ISBN 1-861002-7-26". On pages
| 208-209, there is an example that uses an "include" file by the name
of
| "adovbs.inc". When I try to run the example, I get an error message
| that says it can't find the adovbs.inc file. When I rename the file
| "adovbs.asp" it works just fine. Does anyone know why it will not
work
| with the ".inc" file extension?
|
| I'm running Visual Studio 6 on Windows XP Professional. The example
| uses a Microsoft Access database file by the name of Sailors which can
| be downloaded from Wrox.
|
| Carl Olsen, MCSE
| Des Moines, Iowa
| http://carl-olsen.com/
~8^) Pat Wong (ICQ #61070813)
http://www.napathon.com/
-------------------------------------------------------------------
"You can't talk to a man with a shotgun in his hand."
Smackwater Jack by Carole King
-------------------------------------------------------------------
Message #3 by "Carl E. Olsen" <carl-olsen@m...> on Sun, 1 Sep 2002 21:11:02 -0500
|
|
The adovbs.inc file comes with the operating system (C:\Program
Files\Common Files\System\ado). The books says to make a copy and place
it in the website directory. I've used include files before, but
they've always been html or asp files. This one definitely works when I
change the extension to ".asp" but does not work if the extension is
".inc". I thought any file extension would work, but not in this case.
There must be some other reason it doesn't work as expected.
Carl Olsen, MCSE
Des Moines, Iowa
http://carl-olsen.com/
> -----Original Message-----
> From: Pat Wong [mailto:vinyl-junkie@n...]
> Sent: Sunday, September 01, 2002 7:47 PM
> To: ASP Databases
> Subject: [asp_databases] Re: include file
>
> When using an include file, the file extension doesn't matter. In
fact,
> you can use any kind of file extension you want. When you downloaded
the
> example from the Wrox website, the include file was probably named
> "adovbs.asp" instead of "adovbs.inc" and that's why you got the error.
> Sounds to me like they have a misprint in the book.
>
>
> | I'm reading "Beginning ASP Databases, ISBN 1-861002-7-26". On pages
> | 208-209, there is an example that uses an "include" file by the name
> of
> | "adovbs.inc". When I try to run the example, I get an error message
> | that says it can't find the adovbs.inc file. When I rename the file
> | "adovbs.asp" it works just fine. Does anyone know why it will not
> work
> | with the ".inc" file extension?
> |
> | I'm running Visual Studio 6 on Windows XP Professional. The example
> | uses a Microsoft Access database file by the name of Sailors which
can
> | be downloaded from Wrox.
> |
> | Carl Olsen, MCSE
> | Des Moines, Iowa
> | http://carl-olsen.com/
>
> ~8^) Pat Wong (ICQ #61070813)
> http://www.napathon.com/
> -------------------------------------------------------------------
> "You can't talk to a man with a shotgun in his hand."
> Smackwater Jack by Carole King
> -------------------------------------------------------------------
>
>
> to unsubscribe send a blank email to leave-asp_databases-
> 1112136X@p...
Message #4 by "Pat Wong" <vinyl-junkie@n...> on Sun, 1 Sep 2002 19:14:06 -0700
|
|
You're probably right about this being a special case. I've used file
extensions of ".inc" and ".ssi" on my include files, and both work just
fine.
----- Original Message -----
From: "Carl E. Olsen" <carl-olsen@m...>
To: "ASP Databases" <asp_databases@p...>
Sent: Sunday, September 01, 2002 7:11 PM
Subject: [asp_databases] Re: include file
| The adovbs.inc file comes with the operating system (C:\Program
| Files\Common Files\System\ado). The books says to make a copy and
place
| it in the website directory. I've used include files before, but
| they've always been html or asp files. This one definitely works when
I
| change the extension to ".asp" but does not work if the extension is
| ".inc". I thought any file extension would work, but not in this
case.
| There must be some other reason it doesn't work as expected.
|
| Carl Olsen, MCSE
| Des Moines, Iowa
| http://carl-olsen.com/
|
|
| > -----Original Message-----
| > From: Pat Wong [mailto:vinyl-junkie@n...]
| > Sent: Sunday, September 01, 2002 7:47 PM
| > To: ASP Databases
| > Subject: [asp_databases] Re: include file
| >
| > When using an include file, the file extension doesn't matter. In
| fact,
| > you can use any kind of file extension you want. When you downloaded
| the
| > example from the Wrox website, the include file was probably named
| > "adovbs.asp" instead of "adovbs.inc" and that's why you got the
error.
| > Sounds to me like they have a misprint in the book.
| >
| >
| > | I'm reading "Beginning ASP Databases, ISBN 1-861002-7-26". On
pages
| > | 208-209, there is an example that uses an "include" file by the
name
| > of
| > | "adovbs.inc". When I try to run the example, I get an error
message
| > | that says it can't find the adovbs.inc file. When I rename the
file
| > | "adovbs.asp" it works just fine. Does anyone know why it will not
| > work
| > | with the ".inc" file extension?
| > |
| > | I'm running Visual Studio 6 on Windows XP Professional. The
example
| > | uses a Microsoft Access database file by the name of Sailors which
| can
| > | be downloaded from Wrox.
| > |
| > | Carl Olsen, MCSE
| > | Des Moines, Iowa
| > | http://carl-olsen.com/
| >
| > ~8^) Pat Wong (ICQ #61070813)
| > http://www.napathon.com/
| > -------------------------------------------------------------------
| > "You can't talk to a man with a shotgun in his hand."
| > Smackwater Jack by Carole King
| > -------------------------------------------------------------------
Message #5 by hendry rayau <hendry_rayau@y...> on Mon, 02 Sep 2002 09:38:05 +0700
|
|
you can find adovbs.inc by using find files then check whether it is in a
correct link.
for instance i put my adovbs.inc in my root directory.
<!-- #include file="c:\adovbs.inc" -->
----- Original Message -----
From: "Carl E. Olsen" <carl-olsen@m...>
To: "ASP Databases" <asp_databases@p...>
Sent: Monday, September 02, 2002 7:37 AM
Subject: [asp_databases] include file
> I'm reading "Beginning ASP Databases, ISBN 1-861002-7-26". On pages
> 208-209, there is an example that uses an "include" file by the name of
> "adovbs.inc". When I try to run the example, I get an error message
> that says it can't find the adovbs.inc file. When I rename the file
> "adovbs.asp" it works just fine. Does anyone know why it will not work
> with the ".inc" file extension?
>
> I'm running Visual Studio 6 on Windows XP Professional. The example
> uses a Microsoft Access database file by the name of Sailors which can
> be downloaded from Wrox.
>
> Carl Olsen, MCSE
> Des Moines, Iowa
> http://carl-olsen.com/
>
>
>
>
>
Message #6 by "Carl E. Olsen" <carl-olsen@m...> on Sun, 1 Sep 2002 22:12:24 -0500
|
|
It works by simply changing the file extension from ".inc" to ".asp", so
link it is just fine.
<!-- #include file="c:\adovbs.asp" --> works just fine
<!-- #include file="c:\adovbs.inc" --> does not work
If anyone else has experienced this, I would appreciate hearing your
explanation.
Carl Olsen, MCSE
Des Moines, Iowa
http://carl-olsen.com/
> -----Original Message-----
> From: hendry rayau [mailto:hendry_rayau@y...]
> Sent: Sunday, September 01, 2002 9:38 PM
> To: ASP Databases
> Subject: [asp_databases] Re: include file
>
> you can find adovbs.inc by using find files then check whether it is
in a
> correct link.
> for instance i put my adovbs.inc in my root directory.
>
> <!-- #include file="c:\adovbs.inc" -->
>
>
> ----- Original Message -----
> From: "Carl E. Olsen" <carl-olsen@m...>
> To: "ASP Databases" <asp_databases@p...>
> Sent: Monday, September 02, 2002 7:37 AM
> Subject: [asp_databases] include file
>
>
> > I'm reading "Beginning ASP Databases, ISBN 1-861002-7-26". On pages
> > 208-209, there is an example that uses an "include" file by the name
of
> > "adovbs.inc". When I try to run the example, I get an error message
> > that says it can't find the adovbs.inc file. When I rename the file
> > "adovbs.asp" it works just fine. Does anyone know why it will not
work
> > with the ".inc" file extension?
> >
> > I'm running Visual Studio 6 on Windows XP Professional. The example
> > uses a Microsoft Access database file by the name of Sailors which
can
> > be downloaded from Wrox.
> >
> > Carl Olsen, MCSE
> > Des Moines, Iowa
> > http://carl-olsen.com/
> >
> >
> >
> >
> >
>
>
> to unsubscribe send a blank email to leave-asp_databases-
> 1112136X@p...
Message #7 by "Ken Schaefer" <ken@a...> on Mon, 2 Sep 2002 16:22:42 +1000
|
|
Sorry to ask the obvious question but do you actually have a file called
adovbs.inc? Or is the file called adovbs.asp? You can't include a file that
doesn't exist!
Also, file="..." should only be used for files /inside/ the webroot. The
fact that you are including files outside the webroot indicates that you
have "Enable Parent Paths" on, which leaves you vulnerable to file-traversal
attacks (eg attackers going outside your webroot to execute cmd.exe or
similar)
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Carl E. Olsen" <carl-olsen@m...>
Subject: [asp_databases] Re: include file
: It works by simply changing the file extension from ".inc" to ".asp", so
: link it is just fine.
:
: <!-- #include file="c:\adovbs.asp" --> works just fine
:
: <!-- #include file="c:\adovbs.inc" --> does not work
:
: If anyone else has experienced this, I would appreciate hearing your
: explanation.
:
: Carl Olsen, MCSE
: Des Moines, Iowa
: http://carl-olsen.com/
:
:
: > -----Original Message-----
: > From: hendry rayau [mailto:hendry_rayau@y...]
: > Sent: Sunday, September 01, 2002 9:38 PM
: > To: ASP Databases
: > Subject: [asp_databases] Re: include file
: >
: > you can find adovbs.inc by using find files then check whether it is
: in a
: > correct link.
: > for instance i put my adovbs.inc in my root directory.
: >
: > <!-- #include file="c:\adovbs.inc" -->
: >
: >
: > ----- Original Message -----
: > From: "Carl E. Olsen" <carl-olsen@m...>
: > To: "ASP Databases" <asp_databases@p...>
: > Sent: Monday, September 02, 2002 7:37 AM
: > Subject: [asp_databases] include file
: >
: >
: > > I'm reading "Beginning ASP Databases, ISBN 1-861002-7-26". On pages
: > > 208-209, there is an example that uses an "include" file by the name
: of
: > > "adovbs.inc". When I try to run the example, I get an error message
: > > that says it can't find the adovbs.inc file. When I rename the file
: > > "adovbs.asp" it works just fine. Does anyone know why it will not
: work
: > > with the ".inc" file extension?
: > >
: > > I'm running Visual Studio 6 on Windows XP Professional. The example
: > > uses a Microsoft Access database file by the name of Sailors which
: can
: > > be downloaded from Wrox.
: > >
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #8 by "Carl E. Olsen" <carl-olsen@m...> on Mon, 2 Sep 2002 11:49:58 -0500
|
|
The file that comes with the operating system is "adovbs.inc"
I made a copy and put it in my root web folder. I put the following
code in the body of my page:
<!-- #include file="adovbs.inc" -->
and it did not work.
I renamed the file as "adovbs.asp" and changed the code in the body of
my page to:
<!-- #include file="adovbs.asp" -->
and now it works.
Again, my question is: Why does changing the file extension from ".inc"
to ".asp" make it work? Why doesn't it work when the file is named
"adovbs.inc"?
Carl Olsen
> -----Original Message-----
> From: Ken Schaefer [mailto:ken@a...]
> Sent: Monday, September 02, 2002 1:23 AM
> To: ASP Databases
> Subject: [asp_databases] Re: include file
>
> Sorry to ask the obvious question but do you actually have a file
called
> adovbs.inc? Or is the file called adovbs.asp? You can't include a file
> that
> doesn't exist!
>
> Also, file="..." should only be used for files /inside/ the webroot.
The
> fact that you are including files outside the webroot indicates that
you
> have "Enable Parent Paths" on, which leaves you vulnerable to file-
> traversal
> attacks (eg attackers going outside your webroot to execute cmd.exe or
> similar)
>
> Cheers
> Ken
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> From: "Carl E. Olsen" <carl-olsen@m...>
> Subject: [asp_databases] Re: include file
>
>
> : It works by simply changing the file extension from ".inc" to
".asp", so
> : link it is just fine.
> :
> : <!-- #include file="c:\adovbs.asp" --> works just fine
> :
> : <!-- #include file="c:\adovbs.inc" --> does not work
> :
> : If anyone else has experienced this, I would appreciate hearing your
> : explanation.
> :
> : Carl Olsen, MCSE
> : Des Moines, Iowa
> : http://carl-olsen.com/
> :
> :
> : > -----Original Message-----
> : > From: hendry rayau [mailto:hendry_rayau@y...]
> : > Sent: Sunday, September 01, 2002 9:38 PM
> : > To: ASP Databases
> : > Subject: [asp_databases] Re: include file
> : >
> : > you can find adovbs.inc by using find files then check whether it
is
> : in a
> : > correct link.
> : > for instance i put my adovbs.inc in my root directory.
> : >
> : > <!-- #include file="c:\adovbs.inc" -->
> : >
> : >
> : > ----- Original Message -----
> : > From: "Carl E. Olsen" <carl-olsen@m...>
> : > To: "ASP Databases" <asp_databases@p...>
> : > Sent: Monday, September 02, 2002 7:37 AM
> : > Subject: [asp_databases] include file
> : >
> : >
> : > > I'm reading "Beginning ASP Databases, ISBN 1-861002-7-26". On
pages
> : > > 208-209, there is an example that uses an "include" file by the
name
> : of
> : > > "adovbs.inc". When I try to run the example, I get an error
message
> : > > that says it can't find the adovbs.inc file. When I rename the
file
> : > > "adovbs.asp" it works just fine. Does anyone know why it will
not
> : work
> : > > with the ".inc" file extension?
> : > >
> : > > I'm running Visual Studio 6 on Windows XP Professional. The
example
> : > > uses a Microsoft Access database file by the name of Sailors
which
> : can
> : > > be downloaded from Wrox.
> : > >
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> to unsubscribe send a blank email to leave-asp_databases-
> 1112136X@p...
Message #9 by "Ken Schaefer" <ken@a...> on Tue, 3 Sep 2002 11:00:25 +1000
|
|
Carl,
It should not matter what you call the file, or what extension is used. When
you say "it did not work", what happened? (did you get the "include file not
found" error that you alluded to before?).
What happens if you just create your own file, eg something like:
ThisIsATest.txt
put it into the root of your website, and put some code like:
<%
Response.Write("test worked")
%>
in the .txt file, then do this in another file:
<!-- #include virtual="/ThisIsATest.txt" -->
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Carl E. Olsen" <carl-olsen@m...>
Subject: [asp_databases] Re: include file
: The file that comes with the operating system is "adovbs.inc"
:
: I made a copy and put it in my root web folder. I put the following
: code in the body of my page:
:
: <!-- #include file="adovbs.inc" -->
:
: and it did not work.
:
: I renamed the file as "adovbs.asp" and changed the code in the body of
: my page to:
:
: <!-- #include file="adovbs.asp" -->
:
: and now it works.
:
: Again, my question is: Why does changing the file extension from ".inc"
: to ".asp" make it work? Why doesn't it work when the file is named
: "adovbs.inc"?
:
: Carl Olsen
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #10 by "Peter Foti (PeterF)" <PeterF@S...> on Tue, 3 Sep 2002 10:47:43 -0400
|
|
Hi Carl,
When you say it worked after renaming it to adovbs.asp, does this mean that
you were able to access a database and use the data, or does it mean that it
did not complain that it could not find the include file?
Also, are you including this file from a subdirectory off of the webserver
root directory? If so, then your example will be looking in the *current*
folder, and not in the root. The "file" keyword includes files relative to
the directory where the including file resides (your current directory). If
you use the "virtual" keyword instead, the file is included absolute to the
root of the web site. For example:
<!--#include virtual="/adovbs.asp"-->
It sounds to me like you should be using the virtual keyword instead of
file, since you are not inluding the file relative to your current location.
Also, in general it is a good idea to rename your include files to have a
.asp extension instead of .inc. The reason for this is because if someone
was able to guess the name of your include file, then could enter it into
their browser and get access to your code if it had a .inc extension.
However, with a .asp extension, the webserver will attempt to process the
file as ASP first, and if your file is full of just functions, then a blank
page will be displayed to the user, thus protecting your code from being
seen. Of course, this is not a big issue with the adovbs.inc file since
it's available anywhere, and does not contain any "secret" code, but I still
prefer to rename all of my include files, even if only to be consistent. :)
Hope this helps.
Regards,
Peter
> -----Original Message-----
> From: Carl E. Olsen [mailto:carl-olsen@m...]
> Sent: Monday, September 02, 2002 12:50 PM
> To: ASP Databases
> Subject: [asp_databases] Re: include file
>
>
> The file that comes with the operating system is "adovbs.inc"
>
> I made a copy and put it in my root web folder. I put the following
> code in the body of my page:
>
> <!-- #include file="adovbs.inc" -->
>
> and it did not work.
>
> I renamed the file as "adovbs.asp" and changed the code in the body of
> my page to:
>
> <!-- #include file="adovbs.asp" -->
>
> and now it works.
>
> Again, my question is: Why does changing the file extension
> from ".inc"
> to ".asp" make it work? Why doesn't it work when the file is named
> "adovbs.inc"?
>
> Carl Olsen
>
> > -----Original Message-----
> > From: Ken Schaefer [mailto:ken@a...]
> > Sent: Monday, September 02, 2002 1:23 AM
> > To: ASP Databases
> > Subject: [asp_databases] Re: include file
> >
> > Sorry to ask the obvious question but do you actually have a file
> called
> > adovbs.inc? Or is the file called adovbs.asp? You can't
> include a file
> > that
> > doesn't exist!
> >
> > Also, file="..." should only be used for files /inside/ the webroot.
> The
> > fact that you are including files outside the webroot indicates that
> you
> > have "Enable Parent Paths" on, which leaves you vulnerable to file-
> > traversal
> > attacks (eg attackers going outside your webroot to execute
> cmd.exe or
> > similar)
> >
> > Cheers
> > Ken
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > From: "Carl E. Olsen" <carl-olsen@m...>
> > Subject: [asp_databases] Re: include file
> >
> >
> > : It works by simply changing the file extension from ".inc" to
> ".asp", so
> > : link it is just fine.
> > :
> > : <!-- #include file="c:\adovbs.asp" --> works just fine
> > :
> > : <!-- #include file="c:\adovbs.inc" --> does not work
> > :
> > : If anyone else has experienced this, I would appreciate
> hearing your
> > : explanation.
> > :
> > : Carl Olsen, MCSE
> > : Des Moines, Iowa
> > : http://carl-olsen.com/
> > :
> > :
> > : > -----Original Message-----
> > : > From: hendry rayau [mailto:hendry_rayau@y...]
> > : > Sent: Sunday, September 01, 2002 9:38 PM
> > : > To: ASP Databases
> > : > Subject: [asp_databases] Re: include file
> > : >
> > : > you can find adovbs.inc by using find files then check
> whether it
> is
> > : in a
> > : > correct link.
> > : > for instance i put my adovbs.inc in my root directory.
> > : >
> > : > <!-- #include file="c:\adovbs.inc" -->
> > : >
> > : >
> > : > ----- Original Message -----
> > : > From: "Carl E. Olsen" <carl-olsen@m...>
> > : > To: "ASP Databases" <asp_databases@p...>
> > : > Sent: Monday, September 02, 2002 7:37 AM
> > : > Subject: [asp_databases] include file
> > : >
> > : >
> > : > > I'm reading "Beginning ASP Databases, ISBN 1-861002-7-26". On
> pages
> > : > > 208-209, there is an example that uses an "include"
> file by the
> name
> > : of
> > : > > "adovbs.inc". When I try to run the example, I get an error
> message
> > : > > that says it can't find the adovbs.inc file. When I
> rename the
> file
> > : > > "adovbs.asp" it works just fine. Does anyone know why it will
> not
> > : work
> > : > > with the ".inc" file extension?
> > : > >
> > : > > I'm running Visual Studio 6 on Windows XP Professional. The
> example
> > : > > uses a Microsoft Access database file by the name of Sailors
> which
> > : can
> > : > > be downloaded from Wrox.
> > : > >
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> >
> > to unsubscribe send a blank email to leave-asp_databases-
> > 1112136X@p...
>
>
>
>
|
|
 |