Problems with script in ASP page

I

Indiana

Situation: in an ASP page i have created i read a table and i display an ID
from the table then i have a button and when i click on a run a new query and
then the window has to be closed. (This page is an example page made it to
specify my problem)
The problem: when i click the button the btnsave_onclick proc is executed
but if i insert the commands to open my table it is non completely executed.
If i leave only a msgbox("HELLO") and a window.close commands there are non
problem. If i insert all the rows to create a connection i don't see the
msgbox("HELLO"); another problem is that i have set some Application
variables in Global.ASA and normally i can read them from vbscript code buto
in this proc i can't read them. Where is my error ?
I put my asp page code.
Thanks in advance for help.

<script LANGUAGE="vbscript">
Sub btnsave_onclick

dbconn = CreateObject("ADODB.Connection")

' from here commands are not executed
'and variables are non read
dbconn.ConnectionString = "Provider=VFPOLEDB;Data
Source=c:\inetpub\wwwroot\acut\database\Aupd\;Collating Sequence=Machine"
dbconn.Open "",""
'dbConn.ConnectionString = Application(Aupd_connectionstring")
'dbconn.Open
Application("dbconn_RuntimeUserName"),Application("DbConn_RuntimePassword")
SQLQuery= "Select * From Usrs"

msgbox("HELLO")

window.Close

End Sub
</script>

<%
cId = Request.QueryString("Id")

Set dbconn = Server.CreateObject("ADODB.Connection")
dbconn.ConnectionString =Application("Aupd_connectionstring")
dbconn.Open
Application("dbconn_RuntimeUserName"),Application("DbConn_RuntimePassword")

SQLQuery= "SELECT Usrs.Id, Usrs.psw, Usrs.Cli, Usrs.Mail, Usrs.Tipo,
Usrs.Area, Usrs.Act " & _
"From Usrs " & _
"Where Id='" & cId & "' " & _
"order by Id"

Set RS=dbconn.Execute(SQLQuery)
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Test</title>
</head>
<body>
<% Response.Write(Rs("Id"))%>
<p><STRONG><FONT face=Tahoma color=dimgray size="2">
<INPUT id=btnsave type=submit value="Conferma"></FONT></STRONG></p>
</body>
</html>
<%
dbconn.Close
Set RS=Nothing
%>
 
R

Ray Costanzo [MVP]

Application variables exist on the server. You're trying to access them
from the client and run client side database code. ASP is a server-side
technology.

Ray at work
 
I

Indiana

Ok, but if i need to read these variables how can i read them. Is it correct
to use post data to server and use another asp page to save my data using
request to read objects' values.

Thanks for help...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top