File Sytem Object versus MSXML

E

Edward

Hello:

I need to dynamically include documents stored in my own website.
The website is coded in ASP.
As far as I know there are two common options: FSO and the MSXML Objects.
Which one of the two would be less of a resource hog for IIS ? Keep in mind
that the documetns I want to include are stored in the server where the
website resides, not on another webserver. Otherwise I'd have no choice but
to use msxml.

Thanks in advance.

Edward
 
A

Anthony Jones

Edward said:
Hello:

I need to dynamically include documents stored in my own website.
The website is coded in ASP.
As far as I know there are two common options: FSO and the MSXML Objects.
Which one of the two would be less of a resource hog for IIS ? Keep in mind
that the documetns I want to include are stored in the server where the
website resides, not on another webserver. Otherwise I'd have no choice but
to use msxml.

I'm not sure why you would think MSXML would figure in any such solution.
FSO is easy enough to use for standard text content. ADODB.Stream is a more
flexible solution that handles both text and binary content fairly well
 
D

Dave Anderson

Edward said:
I need to dynamically include documents stored in my own
website. The website is coded in ASP.

Depending on what you mean by "dynamically include", you could include
Server.Execute() or <IFRAME> to solve your problem, as well.
 
M

McKirahan

Edward said:
Hello:

I need to dynamically include documents stored in my own website.
The website is coded in ASP.
As far as I know there are two common options: FSO and the MSXML Objects.
Which one of the two would be less of a resource hog for IIS ? Keep in mind
that the documetns I want to include are stored in the server where the
website resides, not on another webserver. Otherwise I'd have no choice but
to use msxml.

Thanks in advance.

Are you aware of this?

<!--#include file="{yourFile}"-->
 
E

Edward

Thank you guys for the replies.

1. Yes, I know about includes. The known problem with includes is that one
cannot use variables in them.

2. I didn't know about Server.Execute (Yeah, I know, I am a newbie LOL).
This will be for me the best solution when it comes to dynamically inserting
local documents into my ASP pages.
There are some limitations, of course, like variables not passed back and
forth between documents.

3. I still will use XMLHTTP to fetch some content from other server(s). Some
of the advantages of this over the suggested IFRAME tag are:

a- The content becomes part of your page, making search engines spider it as
if were yours.
b- With IFRAME the inserted page probably won't be spidered, and it would
create an additional scroll bar, which tends to confuse visitors.

Thanks again for the feedback

Edward
 
J

Justin Piper

2. I didn't know about Server.Execute (Yeah, I know, I am a newbie LOL).
This will be for me the best solution when it comes to dynamically
inserting
local documents into my ASP pages.
There are some limitations, of course, like variables not passed back and
forth between documents.

You can use the MTxSpm.SharedPropertyGroupManager object to pass
information between pages. You can pass anything you like from a page to
any page it calls using Server.Execute, and those pages can pass scalars
(but not objects) back. A short example follows:

index.asp:
<% Option Explicit

' A function that will be exposed to the page
Function F : F = "index.asp -- F()" : End Function

' Determine the page to execute
Dim page
Select Case Request.QueryString("page")
Case "c" : page = "c.asp"
Case "b" : page = "b.asp"
Case Else: page = "a.asp"
End Select

' Create a shared property group for that page
Dim grpMgr, propGrp, prop
Set grpMgr = CreateObject("MTxSpm.SharedPropertyGroupManager")
Set propGrp = grpMgr.CreatePropertyGroup(page, 0, 0, Empty)

' Create a shared property that provides access to F()
Set prop = propGrp.CreateProperty("F", Empty)
prop.Value = GetRef("F")
Server.Execute page
%>

a.asp, b.asp, c.asp (be sure to change the value of the Page constant for
each):
<% Option Explicit
Const Page = "a.asp"

' Get the shared property group the page
Dim grpMgr, propGrp, prop
Set grpMgr = CreateObject("MTxSpm.SharedPropertyGroupManager")
Set propGrp = grpMgr.CreatePropertyGroup(Page, 0, 0, Empty)

' Get the shared property that provides access to F()
Set prop = propGrp.CreateProperty("F", Empty)

Response.ContentType = "text/plain"
Response.Write "This is " & Page & vbNewLine

If IsObject(prop.Value) Then
Dim f: Set f = prop.Value
Response.Write "Got " & TypeName(prop.Value) & vbNewLine
Response.Write f()
Else
Response.Write "Expected function object but got " _
& TypeName(prop.Value) & vbNewLine
End If
%>
 
M

Mike Brind

Edward said:
Thank you guys for the replies.

1. Yes, I know about includes. The known problem with includes is that one
cannot use variables in them.

True, but you can conditionally include files if you know there names, which
I suppose you must do if they reside on your server?

<%
Select Case True
Case a
%>
<!--#include file="a.asp"-->
<%
Case b
%>
<!--#include file="b.asp"-->
%>
....
<%
End Select
%>

If you have loads of them, this approach might not be practical though...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top