View Full Version : vbScript + asp
04-16-2006, 09:34 AM
can someone plesae explain to me why this code in an asp page doesn't work correctly, this all the code that is in the asp page:
MyVar = MsgBox ("Are you sure you want to delete List?", vbOKCancel, "MsgBox Example")
If MyVar = 1 Then 'user pressed yes
strSql = "Update recruitmentLists Set DelGrp = 1 AND usey='no' Where groupID =" &Request.QueryString("grp")
Set objRS = gobjConn.Execute(strSql)
Set objRS = Nothing
MsgBox ("List Deleted!"), vbOKOnly)
04-16-2006, 12:10 PM
There is no MsgBox in Asp.
04-16-2006, 10:30 PM
Is it possible to get it to work the wy the code needs to function?
What is an effecient option?
04-16-2006, 10:45 PM
Use Response.Write() to print and the html tag <input> to get values from the user.
04-16-2006, 11:32 PM
a little lost, something like this:
<!--#include file='includes\global.inc'--><!--#include file='includes\db.inc'-->
MsgBox ("Are you sure you want to delete List?", vbOKCancel, 'MsgBox Example')
.write("MyVar = MsgBox ('Are you sure you want to delete List?', vbOKCancel, 'MsgBox Example')")
.write("If MyVar = 1 Then") 'user pressed yes
.write("strSql = 'Update tbl93488 Set DelGrp = 1 AND usey='no' Where groupID =' &Request.QueryString('grp')")
.write("Set objRS = gobjConn.Execute(strSql)")
.write("Set objRS = Nothing")
.write("MsgBox ('List Deleted!'), vbOKOnly)")
04-17-2006, 08:16 PM
No, not at all.
ASP cannot directly interact with the user with things like message boxes. That's why it is a called a server-side language, it does its job before the data gets to the user.
What you need to do is have a form on the HTML page and ask the user. For example the yes button is a submit button for the form that sends them to the page to delete the list.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.