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

Javascript variable and ASP

Status
Not open for further replies.

dandrey

Technical User
Apr 28, 2005
41
CO
Hi, i'm having problems with a variable in Javascript that i'm trying to use with ASP but always get an error.

This is my code:

Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="conn.vbs" -->
<html>
<head>
<meta http-equiv="refresh" content="300; URL=Refresh.asp">
<%
%>

<script language="javascript">
    sqlact="update llamadas set tllamada='"+parent.document.clock.stwa.value+"' where nllam="+parent.document.clock.vrp.value;
   <%response.write sqlact%>
   <%rssave=server.CreateObject("adodb.recordset")
     set rssave=conn.execute(%>sqlact<%)%>
   document.write(sqlact);
</script>
<title>Untitled Document</title>
</head>
<body>
</body>
</html>

this is the error:

Error Type:
Microsoft VBScript compilation (0x800A03EA)
Syntax error
/timer/Refresh.asp, líne 13, column 24
set rssave=conn.execute(



How can i solve this out?
Thx
 
It looks like there is client-side script mixed in with server-side script.

As far as the web server is concerned, the client-side code is just plain text... no different than HTML... it is to be ignored.

As far as the web browser is concerned, it never sees any of the server side script... the server has finished its work and moved on to another task before the browser even gets the page. The only thing the browser sees is the OUTPUT of the Active Server Page.
 
one error....

change:
rssave=server.CreateObject("adodb.recordset")
to
set rssave=server.CreateObject("adodb.recordset")

-DNG
 
To tag onto Sheco's comment, you cannot mix server-side and client-side code as you've done. Quite frankly, from looking at your code, why are you trying to do this client-side? Just write everything in ASP (in your case, VBScript) since everything you're doing looks like it should be done on the server anyway.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top