Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Problem with Script in Asp page

I am very new to asp programming. I have a page where i get data from a table and i can modify them. I open my connection


cId = Request.QueryString("Id")

' creazione dell'oggetto di connessione ADODB
Set dbconn = Server.CreateObject("ADODB.Connection")

' indicazione della connessione odbc sul server
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)

then i write my data using html commands
At the end of my page i have a button and i create a btnsave_onclick function

Sub btnsave_onclick

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

SQLQuery= "Update Usrs Set Cli='" & Trim(CodApp.Value) & "', Psw='" & Trim(Password.Value) & "'," & _
"Mail='" & Trim(Mail.Value) & "' " & _
"Where Id='" & trim(Codice.Value) & "'"
End Sub

The problems are that in this function some vb commands are not correct or are not executed and i can use Application variables from file global.asa. If i exclude all the commands and leave only the window.close command the function is executed so the problem is in the syntax i use.
Someone can help me ? i have to save data and i need to understand which kind of commands to use and how can access the variables stored in global.asa and the difference between source in sub function and that in <% %> at the top of my asp page when i open the table and run a query.

Thanks in advance......


  • FlakesFlakes Member Posts: 642
    can you post the exact error that you are getting ?

  • Indiana_92Indiana_92 Member Posts: 4
    : can you post the exact error that you are getting ?
    There is no error. The execution of the script is interruped. When i click on the button the page remains and nothnig is done. I can do what i want, close, refresh. The window.close command isn't executed. If i cut the line where i do the response.write the window is closed correctly.

Sign In or Register to comment.