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!

"remote scripting error on script tag ?????" 2

Status
Not open for further replies.

1712

Technical User
Nov 8, 2000
66
NL
I have read and tried many examples of remote scripting with asp/htm pages, trying the simplest hello world sample.

The error "An exception of type Microsoft Jscript runtime error: object expected was not handled"
on the tag of the first page(htm) that is as follows for any setup using remote scripting:
<script language=&quot;JavaScript&quot;>RSEnableRemoteScripting(&quot;../_scriptlibrary&quot;);
</script>

Any ideas??
Charlie
 
If the _scriptlibrary dir is on your local web dir u must call it like that(be shure u have the latest _ScriptLibrary from the Microsoft):
Code:
<SCRIPT Language=&quot;JavaScript&quot; src=&quot;_ScriptLibrary/rs.htm&quot;></SCRIPT>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
	RSEnableRemoteScripting();
<script language=&quot;JavaScript&quot;>
 RSEnableRemoteScripting();
</script>
U may try to look at my sample code...
________
George, M
 
George,

I appreciate your response, but I tried different paths to my the rsenableremotescript line but still the same error.
&quot;object expected not handled&quot;

I tried to take a look at your sample rs.zip but could not understand which pieces to look at. I for some reason could not look at any of the htm's.

Could you enlighten me on which files would be the pertinent ones to look at.
 
make sure you include RS.htm

<script src=&quot;/_ScriptLibrary/rs.htm&quot;></script>
<script>
RSEnableRemoteScripting(&quot;/_ScriptLibrary&quot;)
</script> .
.. Eat, think and be merry .
... ....................... .
 
I did include the Rs file in the asp page as per the examples. The error always points to the rsenableremotescripting(&quot;../_scriptlibrary&quot;) line. I have the latest rs.asp, rsproxyclass, rs.htm files.

thanks for any help
 
Make sure you have the _scriptlibrary in the root of your web site, and make sure the directory is readable by the anonymous web user .
.. Eat, think and be merry .
... ....................... .
 
Your tip on making sure the directory is readable was the trick. Thanks alot for your help. Being a lone ranger is tough on tricky problems like this. No book or samples anywhere mentioned anything about this.
 
no problem. if you get a chance, mark my post as helpful.

thanks .
.. Eat, think and be merry .
... ....................... .
 
If u need help on the Remote Scripting please tell Us... ________
George, M
 

On remote scripting, I get an error that it cannot create the object rsgetaspobject in the calling htm page. I am doing this just like the book. Any ideas??

******* areahtm.htm **********
<HTML>
<HEAD>
<script language=&quot;vbscript&quot;>
Function invokeHrw()
Dim retobj
Dim aspobj

error-->Set aspobj = RSGetASPObject(&quot;area.asp&quot;)
set retobj = aspobj.HRW()
msgbox retobj.return_value
end function
</script>
</HEAD>

<BODY onload=&quot;invokehrw&quot;>

<script language=&quot;JavaScript&quot; src=&quot;../_scriptlibrary/rs.htm&quot;>
</script>

<script language=&quot;JavaScript&quot;>RSEnableRemoteScripting(&quot;../_scriptlibrary&quot;);
</script>

<P>&nbsp;</P>
<P align=center><FONT size=5>Build and Maintain Areas </FONT></P>

</BODY>
</HTML>

************ area.asp **************************
<%@ Language=VBScript %>
<%

class clsHello
Public Function HRW()
HRW = &quot;Hello Remote World!&quot;
end function
end class

Set Public_description = New clsHello

RSDispatch

dim conn
dim strconnection
dim cmd
dim adparams
dim rs
dim rs2
dim strsql
dim strsql2
Dim strDescription
Dim lookupVal
dim lookupField
' set conn = createobject(&quot;adodb.connection&quot;)
' strconnection = &quot;nwc&quot;
' conn.open strconnection, &quot;cbrown&quot;, &quot;1712&quot;
' set rs = createobject(&quot;adodb.recordset&quot;)
' strsql = &quot;select * from area order by Description&quot;

' RS.Open strsql, conn, adOpenDynamic,adLockBatchOptimistic
%>

<!-- #INCLUDE FILE=&quot;../_scriptlibrary/rs.asp&quot; -->
 
<script language=&quot;JavaScript&quot; src=&quot;../_scriptlibrary/rs.htm&quot;>
</script>

that needs to be the first thing on the page .
.. Eat, think and be merry .
... ....................... .
 
George,
Once again you got me a little farther and I marked you for another helpful post. Interesting that you told me to move the script language.....rs.htm above everything, because this book(wrox) on vbscript had it below.

Anyway I was trying to execute the function through a button but it fails right back to the original place of set aspobj = rsgetaspobject(&quot;area.asp&quot;). Same error on object

<HTML>
<HEAD>
<script language=&quot;JavaScript&quot; src=&quot;../_scriptlibrary/rs.htm&quot;>
</script>
<script language=&quot;vbscript&quot;>
Function invokeHrw()
Dim retobj
Dim aspobj

error--->Set aspobj = RSGetASPObject(&quot;area.asp&quot;)
set retobj = aspobj.HRW()
msgbox retobj.return_value
end function
</script>
<META name=&quot;VI60_DefaultClientScript&quot; Content=&quot;VBScript&quot;>

<META NAME=&quot;GENERATOR&quot; Content=&quot;Microsoft Visual Studio 6.0&quot;>
</HEAD>


<BODY >



<script language=&quot;JavaScript&quot;>RSEnableRemoteScripting(&quot;../_scriptlibrary&quot;);
</script>

<P>&nbsp;</P>
<P align=center><FONT size=5>Build and Maintain Areas </FONT></P>
<p> <form name=area.asp action=&quot;Area.asp&quot; method=&quot;post&quot;></p>
<P align=center><FONT size=5>

<SELECT id=Select1 style=&quot;WIDTH: 201px; HEIGHT: 188px&quot; size=2 name=select1 >


</SELECT>&nbsp;&nbsp;</FONT></P>



<p align=center>

</p>
<p align=center ><FONT size=4>Area&nbsp; </FONT>

<INPUT id=txtDescription name=txtDescription size=&quot;30&quot; ></p>
<p align=center>
<INPUT type=&quot;submit&quot; value=&quot;New&quot; name=New >&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT type=&quot;submit&quot; value=&quot;Delete&quot; name=Delete >&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT type=&quot;submit&quot; value=&quot;Save&quot; name=Save >&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT type=&quot;submit&quot; value=&quot;Close&quot; name=Close >&nbsp;&nbsp;&nbsp;&nbsp;
<INPUT type=&quot;button&quot; value=&quot;test&quot; name=test onclick=&quot;invokehrw()&quot; >&nbsp;&nbsp;&nbsp;&nbsp;


I appreciate your help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top