473,396 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,str
fName=document.form1.file1.value

set objfs = CreateObject("Scripting.FileSystemObject")
set objFile=objfs.OpenTextFile(fName)
str=""
do while objFile.AtEndOfStream<>true
strline = objFile.ReadLine
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 2480
"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 FileSystemObject 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.com> wrote in message
news:uh****************@tk2msftngp13.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=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,str
fName=document.form1.file1.value

set objfs = CreateObject("Scripting.FileSystemObject")
set objFile=objfs.OpenTextFile(fName)
str=""
do while objFile.AtEndOfStream<>true
strline = objFile.ReadLine
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.com> wrote in message
news:uh****************@tk2msftngp13.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=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,str
fName=document.form1.file1.value

set objfs = CreateObject("Scripting.FileSystemObject")
set objFile=objfs.OpenTextFile(fName)
str=""
do while objFile.AtEndOfStream<>true
strline = objFile.ReadLine
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.com> wrote in message
news:uh****************@tk2msftngp13.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=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,str
fName=document.form1.file1.value

set objfs = CreateObject("Scripting.FileSystemObject")
set objFile=objfs.OpenTextFile(fName)
str=""
do while objFile.AtEndOfStream<>true
strline = objFile.ReadLine
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.com> wrote in message
news:uh****************@tk2msftngp13.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=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,str
fName=document.form1.file1.value

set objfs = CreateObject("Scripting.FileSystemObject")
set objFile=objfs.OpenTextFile(fName)
str=""
do while objFile.AtEndOfStream<>true
strline = objFile.ReadLine
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.com> wrote in message
news:uh****************@tk2msftngp13.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=clientEventHandlersVBS LANGUAGE=vbscript>
<!--
Sub button1_onclick
dim fName,strline,i
dim objfs,objFile,str
fName=document.form1.file1.value

set objfs = CreateObject("Scripting.FileSystemObject")
set objFile=objfs.OpenTextFile(fName)
str=""
do while objFile.AtEndOfStream<>true
strline = objFile.ReadLine
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
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,...
4
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...
55
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
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...
3
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...
2
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...
0
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...
2
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 : ...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...

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.