Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INCLUDE VIRTUAL 1

Status
Not open for further replies.

catgirl

Programmer
Jan 3, 2001
13
0
0
US
Hi,

I'm trying to use #include virtual="\\\servername\path\filename" in a script. The file I want to include is on a different drive. But when I do it I get this error message

Active Server Pages error 'ASP 0126'

Include file not found

and then it lists the correct file which I can copy and paste into another browser window and pull up. That way I know the file exists and I do not have a typing error.

Note: I know I used 3 backslashes \\\, but the actual code only recognizes two of them.

Any ideas about what I am doing wrong or if there is another way to get at this file.

Note, if I use an anchor and a link, I do not have a problem getting at the file. The reason I wanted to use the include is so I can specify the background for the file.



 
virtual only points to the root of the website. So, unless you have the other drive mapped through IIS, you won't be able to use virtual.

Try using
<!--#include file=&quot;\\UNCPATH\folder\file.txt-->

I've never tried this, so I don't know if it'll work, but I know that virtual won't work. File should, since that wants the actual physical location of the file.

hth
leo
 
what does the UNCPATH stand for? I've tried <!--#include file=&quot;\\Servername\path\file&quot;-->

but I get the error

Active Server Pages error 'ASP 0130'

Invalid File attribute

File attribute cannot start with forward slash or back slash.
 
UNC is Universal Naming Convention (gasp - I'm wearing my geek hat right now). It's the path used by networks to determine how to get to any computer. Typically it starts with \\computername\sharedfolder\file.txt or something like that.

anyhow -
I think what you would need to do is map the network drive to a local drive. (just right-click on the network drive (in this case servername) in windows explorer, and select map network drive - from there it should appear as a letter - in my example, servername now becomes J:)

try accessing it through file again, that should work.. i think.

<!--#include file=&quot;J:\somefolder\myfile.txt&quot;-->

good luck to ya -
if you need more help, post back, we'll do what we can.
leo
 
No that doesn't work either. I do actually have that mapped to a local Drive.

when I try <!--#include file=&quot;R:\path\file&quot;-->

I get this error

Active Server Pages error 'ASP 0126'

Include file not found

The include file 'R:\path\file' was not found.
 
hm.
well - maybe include isn't allowed to see anything that is not in the web directory... so that might be why you can't call the script.

An alternative might be to use the FSO to read in the file, then output it's results that way. Unfortunately, you can't process any ASP Script using this method, but if you're just trying to show HTML, that won't be too much of a problem. Theoretically, you might be able to process the script using VBScript 5.5 Execute, but I've never tried it.

Check out: faq333-504 for info on reading in files. If this doesn't do it for you, I honestly don't know what can.

Good luck
leo
 
Thanks for all your help. It doesn't look like I'm going to be able to use the include file to do what I want to do. But now I'm trying to use the IFRAME. It will display my file from the other drive. My question now, is there a way to change the background for the IFRAME.
 
You might want to ask in the HTML/CSS forum... I really don't know alot about IFRAME leo
 
It may sound daft but did you include the extension of the file...?
 
Hi all,

It seems to me that include doesn't allow full actual paths, only webdirectory paths.

Maybe this text from a book by O'Reilly will explain it a bit:

----
<!-- #include Pathtype = strFileName -->
file: treats the value of the strFileName parameter as a relative path from the current directory
virtual: treats the value of the strFileName parameter as a full virtual path.
(ie. from the root)
----

So, a typical file path would be something like this:
&quot;../someInclude.inc&quot;
While a virtual path would be:
&quot;/includes/someInclude.inc&quot;

Hope I could be of service? :p

Gtz,

Kristof
 
Yes I did use the file extenstion when using the include file. Thanks for everyone's help. I guess I'll go to HTML and see if anyone knows anything more about IFRAME.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top