473,594 Members | 2,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

urgent help needed!!


Hi all

we are getting active x component can not create object (Error No. 16) while
creating an instance of File System Object in ASP client side script. Could
you plz help us in solving this problem. We were working on opening a
selected text file at client site and inputing the content. I have pasted
the same code bellow of which plz find in order.

<SCRIPT ID=clientEventH andlersVBS LANGUAGE=vbscri pt>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,s tr
fName=document. form1.file1.val ue

set objfs = CreateObject("S cripting.FileSy stemObject")
set objFile=objfs.O penTextFile(fNa me)
str=""
do while objFile.AtEndOf Stream<>true
strline = objFile.ReadLin e
if str="" then
str=strline
else
str=str & "," & strline
end if
loop
objFile.close
set objfs=nothing
document.form1. text1.value=str
End Sub

-->
</SCRIPT>

Now the file is pure html file and i have writen a client site script.
Irrespective of whether the client site the object present or not, if i open
the html file by double clicking onto it. I am getting the file read. The
same thing if i run it over IIS with a hyperlink onto the same machine, am
getting Active X Component can not create object. Where as in my browser
setting i have active x support enabled.
I was just amazed as if i run the script directly am getting the result and
when i do the same using IIS it was giving error.
So plz do help me in this regards.

Thanks a lot for your time.

Regards
Jul 19 '05 #1
7 2491
"Catherine Jones" wrote...
We were working on opening a
selected text file at client site and inputing the content.


I *believe* you'll find that the FileSystem object is only server side,
therefore you will not be able to use this to open the document on the
client.

In this scenario you would need to be able to send the file to the server
first (file upload), and then read it in using the FileSystem object
afterwards..

I may have not fully understood what you were trying to do - so my
appologies if so...

Regards

Rob
Jul 19 '05 #2
The FileSystemObjec t is not available client-side (for obvious security
reasons).

Two possible solutions:
1 - use a form, ask the user to upload the file (<input type="file" ... >)
2- build a custom ActiveX control to do that (assuming that the user will
accept to execute it).

"Catherine Jones" <no*@moreply.co m> wrote in message
news:uh******** ********@tk2msf tngp13.phx.gbl. ..

Hi all

we are getting active x component can not create object (Error No. 16) while creating an instance of File System Object in ASP client side script. Could you plz help us in solving this problem. We were working on opening a
selected text file at client site and inputing the content. I have pasted
the same code bellow of which plz find in order.

<SCRIPT ID=clientEventH andlersVBS LANGUAGE=vbscri pt>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,s tr
fName=document. form1.file1.val ue

set objfs = CreateObject("S cripting.FileSy stemObject")
set objFile=objfs.O penTextFile(fNa me)
str=""
do while objFile.AtEndOf Stream<>true
strline = objFile.ReadLin e
if str="" then
str=strline
else
str=str & "," & strline
end if
loop
objFile.close
set objfs=nothing
document.form1. text1.value=str
End Sub

-->
</SCRIPT>

Now the file is pure html file and i have writen a client site script.
Irrespective of whether the client site the object present or not, if i open the html file by double clicking onto it. I am getting the file read. The
same thing if i run it over IIS with a hyperlink onto the same machine, am
getting Active X Component can not create object. Where as in my browser
setting i have active x support enabled.
I was just amazed as if i run the script directly am getting the result and when i do the same using IIS it was giving error.
So plz do help me in this regards.

Thanks a lot for your time.

Regards

Jul 19 '05 #3
it sounds like she is running it client-side

"Catherine Jones" <no*@moreply.co m> wrote in message
news:uh******** ********@tk2msf tngp13.phx.gbl. ..

Hi all

we are getting active x component can not create object (Error No. 16) while creating an instance of File System Object in ASP client side script. Could you plz help us in solving this problem. We were working on opening a
selected text file at client site and inputing the content. I have pasted
the same code bellow of which plz find in order.

<SCRIPT ID=clientEventH andlersVBS LANGUAGE=vbscri pt>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,s tr
fName=document. form1.file1.val ue

set objfs = CreateObject("S cripting.FileSy stemObject")
set objFile=objfs.O penTextFile(fNa me)
str=""
do while objFile.AtEndOf Stream<>true
strline = objFile.ReadLin e
if str="" then
str=strline
else
str=str & "," & strline
end if
loop
objFile.close
set objfs=nothing
document.form1. text1.value=str
End Sub

-->
</SCRIPT>

Now the file is pure html file and i have writen a client site script.
Irrespective of whether the client site the object present or not, if i open the html file by double clicking onto it. I am getting the file read. The
same thing if i run it over IIS with a hyperlink onto the same machine, am
getting Active X Component can not create object. Where as in my browser
setting i have active x support enabled.
I was just amazed as if i run the script directly am getting the result and when i do the same using IIS it was giving error.
So plz do help me in this regards.

Thanks a lot for your time.

Regards

Jul 19 '05 #4
Running the HTML page from local disk places it in the 'intranet' security
zone of IE as opposed to running it from an http:\\ protocol which places it
firmly in the 'internet' zone.
I think you'll find that on XP the access to the local FSO is also blocked
irrespective of where the html file is loaded from.
I had a requirement recently to do this for a browser control hosted in a VB
application (obviously FSO should be allowed in this case) and had to write
my own ActiveX control to install with the VB app marked as 'Safe For
Scripting' so that I could do things like saving XML files directly from the
HTML without getting security errors. This worked a treat but of course is
totally unacceptable for an environment where the user doesn't want to have
to install an ActiveX control just to see your HTML page.

You *can* do this in a normal IE environment but the user will have to
either accept the security warning (if loaded as a .hta cos it won't work at
all otherwise) or accept the downloading and installation of the ActiveX
control - mine is Authenticode signed by my company of course. In both
scenarios you are at the mercy of the users acceptance of the warnings.

Chris.

"Catherine Jones" <no*@moreply.co m> wrote in message
news:uh******** ********@tk2msf tngp13.phx.gbl. ..

Hi all

we are getting active x component can not create object (Error No. 16) while
creating an instance of File System Object in ASP client side script. Could
you plz help us in solving this problem. We were working on opening a
selected text file at client site and inputing the content. I have pasted
the same code bellow of which plz find in order.

<SCRIPT ID=clientEventH andlersVBS LANGUAGE=vbscri pt>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,s tr
fName=document. form1.file1.val ue

set objfs = CreateObject("S cripting.FileSy stemObject")
set objFile=objfs.O penTextFile(fNa me)
str=""
do while objFile.AtEndOf Stream<>true
strline = objFile.ReadLin e
if str="" then
str=strline
else
str=str & "," & strline
end if
loop
objFile.close
set objfs=nothing
document.form1. text1.value=str
End Sub

-->
</SCRIPT>

Now the file is pure html file and i have writen a client site script.
Irrespective of whether the client site the object present or not, if i open
the html file by double clicking onto it. I am getting the file read. The
same thing if i run it over IIS with a hyperlink onto the same machine, am
getting Active X Component can not create object. Where as in my browser
setting i have active x support enabled.
I was just amazed as if i run the script directly am getting the result and
when i do the same using IIS it was giving error.
So plz do help me in this regards.

Thanks a lot for your time.

Regards

Jul 19 '05 #5
Many Many thanx to all four of you, for providing such
great and timely help.
Thanx once again.
"Catherine Jones" <no*@moreply.co m> wrote in message
news:uh******** ********@tk2msf tngp13.phx.gbl. ..

Hi all

we are getting active x component can not create object (Error No. 16) while creating an instance of File System Object in ASP client side script. Could you plz help us in solving this problem. We were working on opening a
selected text file at client site and inputing the content. I have pasted
the same code bellow of which plz find in order.

<SCRIPT ID=clientEventH andlersVBS LANGUAGE=vbscri pt>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,s tr
fName=document. form1.file1.val ue

set objfs = CreateObject("S cripting.FileSy stemObject")
set objFile=objfs.O penTextFile(fNa me)
str=""
do while objFile.AtEndOf Stream<>true
strline = objFile.ReadLin e
if str="" then
str=strline
else
str=str & "," & strline
end if
loop
objFile.close
set objfs=nothing
document.form1. text1.value=str
End Sub

-->
</SCRIPT>

Now the file is pure html file and i have writen a client site script.
Irrespective of whether the client site the object present or not, if i open the html file by double clicking onto it. I am getting the file read. The
same thing if i run it over IIS with a hyperlink onto the same machine, am
getting Active X Component can not create object. Where as in my browser
setting i have active x support enabled.
I was just amazed as if i run the script directly am getting the result and when i do the same using IIS it was giving error.
So plz do help me in this regards.

Thanks a lot for your time.

Regards

Jul 19 '05 #6
"Catherine Jones" wrote ...
Many Many thanx to all four of you, for providing such great and timely help. Thanx once again.


You're welcome :o)

Rob
Jul 19 '05 #7
Many Many thanx to all four of you, for providing such
great and timely help.
Thanx once again.
"Catherine Jones" <no*@moreply.co m> wrote in message
news:uh******** ********@tk2msf tngp13.phx.gbl. ..

Hi all

we are getting active x component can not create object (Error No. 16) while creating an instance of File System Object in ASP client side script. Could you plz help us in solving this problem. We were working on opening a
selected text file at client site and inputing the content. I have pasted
the same code bellow of which plz find in order.

<SCRIPT ID=clientEventH andlersVBS LANGUAGE=vbscri pt>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,s tr
fName=document. form1.file1.val ue

set objfs = CreateObject("S cripting.FileSy stemObject")
set objFile=objfs.O penTextFile(fNa me)
str=""
do while objFile.AtEndOf Stream<>true
strline = objFile.ReadLin e
if str="" then
str=strline
else
str=str & "," & strline
end if
loop
objFile.close
set objfs=nothing
document.form1. text1.value=str
End Sub

-->
</SCRIPT>

Now the file is pure html file and i have writen a client site script.
Irrespective of whether the client site the object present or not, if i open the html file by double clicking onto it. I am getting the file read. The
same thing if i run it over IIS with a hyperlink onto the same machine, am
getting Active X Component can not create object. Where as in my browser
setting i have active x support enabled.
I was just amazed as if i run the script directly am getting the result and when i do the same using IIS it was giving error.
So plz do help me in this regards.

Thanks a lot for your time.

Regards

Jul 19 '05 #8

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

Similar topics

4
1310
by: Random | last post by:
The way I've built my page is to take the user through a multi-form process, only rendering those controls that are needed for each section. The ViewState is working the way I want it to, remembering items across the process, back and forth. But when the user finally opts to complete the sections and commit the information for processing, I can't access any of the information that was not rendered on the last section. It's obviously in...
4
4133
by: XML newbie: Urgent pls help! | last post by:
I am using VB.Net. My program is to connect to a remote IPAddress. Once, it verifies the login information it should display the SessionID and enable some button . I appreciate your help and thanku in advance When I run the pgm , I get the error: Can't parse login information. Namespace Manager or XsltContext needed. This query has a prefix, variable or userdefined function. I have added the Try-catch in all my functions. In...
55
2704
by: Steven Nagy | last post by:
Hi all, Sorry I have no time to test this myself.... Can I add the same attribute to a field twice? Eg. Public string myField;
7
4056
by: meenasamy | last post by:
Hi all, i need to create a function that takes three parameters( Original currency, needed currency, amount) i need to convert from the original currency to the needed currency the amount and return the new amount in the needed currency, I need this function to work real time (obtaining real time currency exchange rates), any ideas???
3
6450
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from the socket is missing the last character (line feed). When the same text is sent without the urgent flag set, all of the characters are read. I'm reading the data using the blocking read call of the network stream class. The .NET...
2
2418
by: Preetam Pattanashetty | last post by:
Hi I am learning ASP.NET using C#. I am able to run .aspx files on local system, but when I load them to the server, I get the "Server Error in '/' Application" error. I have tried to configure the web.config file but has not been fruitful. I would be thankful if the following questions were answered: a)has the write permissions on files and folders have to do something with it? b)what role does asp_client folder play? c) What other...
0
2572
by: Christopher | last post by:
Urgent Help Needed: The EPVH-1.1 Visual Hull Library. Dear All, I am a student doing research in computer vision. The EPVH-1.1 Visual Hull Library will really help a lot in my research. I did have this library before but I didn't keep my copy of this library because I always thought I could download it again form internet. However, the author of this library closed the download
2
1429
by: dragonball | last post by:
hi, i want to use log(double) in my java prog. so i have imported java.lang.Math flanagan.math.PsRandom now i wanna use log function in a private method inside a class. so i try : return (94.2)-(0.024*avg_playout_delay)-11-(40*log(1+10*avg_playout_delay));
2
1777
by: rKrishna2k6 | last post by:
We used to run our application on framework 1.1 and upgraded to 3.5 recently(I understood 2.0 and 3.5 are same except for the few add In s) Our Prod environment is on Win 2003 & IIS 6.0 and server(s) is built with 4 CPUs & 4GB RAM. Based on Microsoft thread pool recommendations we have the following Machine.config entries..
0
7947
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7880
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8374
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8010
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6665
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3868
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.