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

Expected End of Statement

Status
Not open for further replies.

almoes

Programmer
Jan 8, 2003
291
US
I have the following code in an html file:

<html>
<head>
</head>
<body>
<form method=&quot;GET&quot; name=&quot;RSPcliForm&quot;>
<table>
<tr>
<td><input TYPE=&quot;Button&quot; VALUE=&quot;Dial&quot; NAME=&quot;btnDial&quot;></td><td><input TYPE=&quot;text&quot; VALUE=&quot;tel&quot; NAME=&quot;telNum&quot;></td>
<td><input TYPE=&quot;Button&quot; VALUE=&quot;Disconnect&quot; NAME=&quot;btnDisconnect&quot;></td>
</tr>
</table>

<OBJECT ID=&quot;RSPclient&quot; NAME=&quot;RSPclient&quot; CLASSID=&quot;CLSID:24B4E4FA-5E05-4800-BBCC-20B8D5F8A811&quot; height=8415 Width=10575></OBJECT>

<script language=vbscript>
Dim RSPserver As RemoteComponent.RSPServer
Set RSPserver=CreateObject(&quot;RemoteComponent.RSPServer&quot;,&quot;10.1.1.200&quot;)
</script>

</form>
</body>
</html>

I get the error: 'Line 15: expected end of statement'
this line points to the first script tag. What's wrong??? I am going nuts!!

Thanks,
alej
 
try removing the DIM statement.

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
 
Then i get:

Error: line 15 'Object variable not set: 'CreateObject'
 
Are you sure that you are able to create this object client-side?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rich Cook
 
I think so! I declared it via DCOM and the config is right so I should be able to create the instance on the client side, but I don't know what's wrong!
 
Hello almoes,

Just being curious,... Why do you need the
&quot;As RemoteComponentRSPServer&quot;?
Can you just end the Dim statement short?
Dim RSPServer

regards - tsuji
 
Yes, the &quot;Dim... As...&quot; syntax is VB, not VBScript.

Change this to simply Dim RSPServer. And where the heck is your Option Explicit? The mark of the true hack (or Absent-minded Professor?) is VBScript without an Option Explicit.

Then correct your CreateObject( ) call. Either drop the &quot;version parameter&quot; (the second parameter to CreateObject( ) is not version) or add the version to the progID parameter where it belongs.

Generally you can only specify the major version in a progID, such as:

Set RSPServer = CreateObject(&quot;RemoteComponent.RSPServer.10&quot;)

But you can check the registry for the valid ProgID and VersionIndependentProgID strings for installed versions of your component.

Be warned that in an ASP page Server.CreateObject( ) is not the same thing as CreateObject( ). Unless you know what you are doing and why, your ASP code should always use Server.CreateObject( ). This has the most visible impact on ADO objects and database connection pooling, but there are side-effects for other types of components as well:

 
Thanks a lot for your remarks, the trouble was coming from the wrapper of the server component. Its running already!!

cheers,
alej
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top