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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

asp and COM question

Status
Not open for further replies.

wduty

Programmer
Jun 24, 2000
271
US
How do you invoke the Scripting.FileSystemObject (normally used in asp) within a VB COM object?

I can access the asp server object by creating it in onStartPage:

[red]public sub onStartPage(sc as scriptingContext)
[tab]set aspServerObj = sc.server()
end sub[/red]

and as long as I only use server methods it works fine. For example, provided the above sub is in the class module I can write:

[red]dim str as string
str = aspServerObj.encodeURL("asdf.com?test=aasdf/asdf/^^")[/red]

but if I try to do:

[red]dim fso as FileSystemObject
set fso = aspServerObj.createObject("Scripting.FileSystemObject")[/red]

and then continue from there to read a file, it doesn't work. I tried a dozen other combinations and none of them worked (although they compiled and I don't get an asp error, just no file output). I access ordinary asp objects (response, request, server mainly) from VB COM all the time and it works fine. But the fileSystemObject is not an asp object. I would read directly from VB but I read somewhere that this is not recommended within IIS. Any help appreciated. [sig]<p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br> [/sig]
 
Actually, I figured it out. Thanks to anyone who might have replied. It must have just been some minor detail since the same approach I was trying suddenly worked after various trials and errors. [sig]<p>--Will Duty<br><a href=mailto:wduty@radicalfringe.com>wduty@radicalfringe.com</a><br><a href= > </a><br> [/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top