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
%>
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
%>