C
Catherine Jones
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
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