473,503 Members | 1,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MsgBox error

I've inserted a MsgBox in some VBScript on line 12 of an .asp page and get
the following error:

Microsoft VBScript runtime error '800a0046'
Permission denied: 'MsgBox'

/default.asp, line 12

The script processes a form and other than this problem with MsgBox, the
script works fine. I've Googled the error but so far haven't found an
answer that applies. Any idea what the problem might be and how I can get
it to work?


Dec 7 '05 #1
7 11318
Bob L wrote:
I've inserted a MsgBox in some VBScript on line 12 of an .asp page
and get the following error:

Microsoft VBScript runtime error '800a0046'
Permission denied: 'MsgBox'

/default.asp, line 12

The script processes a form and other than this problem with MsgBox,
the script works fine. I've Googled the error but so far haven't
found an answer that applies. Any idea what the problem might be and
how I can get it to work?

You can't use MsgBox in server-side code. Think about it. Who will be at the
server's monitor waiting to click the OK button?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Dec 7 '05 #2
That makes sense. Thanks.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OC***************@TK2MSFTNGP12.phx.gbl...
Bob L wrote:
I've inserted a MsgBox in some VBScript on line 12 of an .asp page
and get the following error:

Microsoft VBScript runtime error '800a0046'
Permission denied: 'MsgBox'

/default.asp, line 12

The script processes a form and other than this problem with MsgBox,
the script works fine. I've Googled the error but so far haven't
found an answer that applies. Any idea what the problem might be and
how I can get it to work?

You can't use MsgBox in server-side code. Think about it. Who will be at
the
server's monitor waiting to click the OK button?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Dec 7 '05 #3
As a followup question, is there a way I can code in MsgBox in the .asp page
so that it is processed on the client computer after being process by the
server?
"Bob L" <no****@nospam.com> wrote in message
news:OY****************@TK2MSFTNGP10.phx.gbl...
That makes sense. Thanks.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OC***************@TK2MSFTNGP12.phx.gbl...
Bob L wrote:
I've inserted a MsgBox in some VBScript on line 12 of an .asp page
and get the following error:

Microsoft VBScript runtime error '800a0046'
Permission denied: 'MsgBox'

/default.asp, line 12

The script processes a form and other than this problem with MsgBox,
the script works fine. I've Googled the error but so far haven't
found an answer that applies. Any idea what the problem might be and
how I can get it to work?

You can't use MsgBox in server-side code. Think about it. Who will be at
the
server's monitor waiting to click the OK button?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Dec 7 '05 #4
Somebody posted an example a while back of response.writing a client-side
script block containing a statement that would be executed in the
window_onload event. Something like this:

<%="<script type='text/javascript'>msgbox 'some message'</script>"%>

Bob L wrote:
As a followup question, is there a way I can code in MsgBox in the
.asp page so that it is processed on the client computer after being
process by the server?
"Bob L" <no****@nospam.com> wrote in message
news:OY****************@TK2MSFTNGP10.phx.gbl...
That makes sense. Thanks.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OC***************@TK2MSFTNGP12.phx.gbl...
Bob L wrote:
I've inserted a MsgBox in some VBScript on line 12 of an .asp page
and get the following error:

Microsoft VBScript runtime error '800a0046'
Permission denied: 'MsgBox'

/default.asp, line 12

The script processes a form and other than this problem with
MsgBox, the script works fine. I've Googled the error but so far
haven't found an answer that applies. Any idea what the problem
might be and how I can get it to work?
You can't use MsgBox in server-side code. Think about it. Who will
be at the
server's monitor waiting to click the OK button?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will
get a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Dec 7 '05 #5
Here's what works for me

http://www.codingforums.com/archive/index.php/t-51986
You are using a response.Redirect in the same if then statement which
basically cancels the javascript alert even though the alert is listed above
the redirect.

If this is page is referenced from a form on a different page and that is
what you are redirecting to then you have multiple options.
1) You can rewrite it so that the the form and the form handler are on the
same page. Basically it will then do a postback to itself so then you can do
the alert on eof like you are doing or you can spell out an error on the page
in case the user has a non javascript enabled browser.

And if it isnt the same page being redirected to then you have two more
options
2) You can add a delayed redirect using javascript or a refresh metatag
3)redirect to the other page and pass a variable along with it. Then on the
redirected page use an If/Then statement looking for that variable. Then if
it is true the javascript alert is triggered. like so

on Refering page
if recordset.eof then
recordset.close
Set recordset= Nothing
Response.Redirect "StaffingReview.asp?1"
(IF Multiple send back - Response.Redirect"Staf.asp?a=1&b=2"
End If

On StaffingReview.asp
dim e
e = Request.Querystring
e = Request.Querystring("a") - for multiple
If e = 1 Then
Response.write("<script type=""text/javascript"">alert(""What is the
employee's ID Number? If unavailable enter N/A. Re-select your employee
before filling out the rest of the form."");</script>")
End If

vBulletin v3.0.0, Copyright ©2000-2005, Jelsoft Enterprises Ltd.

"Bob Barrows [MVP]" wrote:
Somebody posted an example a while back of response.writing a client-side
script block containing a statement that would be executed in the
window_onload event. Something like this:

<%="<script type='text/javascript'>msgbox 'some message'</script>"%>

Bob L wrote:
As a followup question, is there a way I can code in MsgBox in the
.asp page so that it is processed on the client computer after being
process by the server?
"Bob L" <no****@nospam.com> wrote in message
news:OY****************@TK2MSFTNGP10.phx.gbl...
That makes sense. Thanks.

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:OC***************@TK2MSFTNGP12.phx.gbl...
Bob L wrote:
> I've inserted a MsgBox in some VBScript on line 12 of an .asp page
> and get the following error:
>
> Microsoft VBScript runtime error '800a0046'
> Permission denied: 'MsgBox'
>
> /default.asp, line 12
>
> The script processes a form and other than this problem with
> MsgBox, the script works fine. I've Googled the error but so far
> haven't found an answer that applies. Any idea what the problem
> might be and how I can get it to work?
You can't use MsgBox in server-side code. Think about it. Who will
be at the
server's monitor waiting to click the OK button?
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will
get a quicker response by posting to the newsgroup.


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Dec 7 '05 #6
Bob Barrows [MVP] wrote:
Somebody posted an example a while back of response.writing a
client-side script block containing a statement that would be
executed in the window_onload event. Something like this:

<%="<script type='text/javascript'>msgbox 'some message'</script>"%>

Oops, that should have been:
type='text/vbscript'
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Dec 7 '05 #7
Bob Barrows [MVP] wrote on 07 dec 2005 in
microsoft.public.inetserver.asp.general:
Bob Barrows [MVP] wrote:
Somebody posted an example a while back of response.writing a
client-side script block containing a statement that would be
executed in the window_onload event. Something like this:

<%="<script type='text/javascript'>msgbox 'some message'</script>"%>

Oops, that should have been:
type='text/vbscript'


and then double quoted strings should be used:

<%="<script type='text/vbscript'>msgbox "some message"</script>"%>

IE only, this clientside vbs.

============================

A problem is, that a subsequent

<span onclick='this.innerHTML+="D"'>ABC</span>

will fail, because the onclick will expect vbs, not js.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Dec 7 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3117
by: JT | last post by:
im trying to use the MsgBox function in the following to display an ASP MsgBox containing text retrieved from the db into a recordset <% set rsMessages= myRecordset msg_text =...
6
5052
by: Lapchien | last post by:
In this bit of code provided so helpfully by Nath: Private Sub Command118_Click() Dim rs As DAO.Recordset Set db = CurrentDb Set rs = db.openrecordset("IMPORT")
1
3501
by: Andrew | last post by:
Here's all of my code... Private Sub Submitted_Click() On Error GoTo Err_Submitted_Click DoCmd.SetWarnings False MsgBox("Have you ensured that no errors are present in the data?", 4, "Are...
2
1461
by: Radith Silva | last post by:
I need to use the MsgBox function like I used to in VB 6.0 So all i do is: MsgBox ("Please provide Input") BUT IN .NET: The error reads "msgbox is a namespace"
2
3216
by: Parasyke | last post by:
I have an email Sub set up that works fine except upon a successful send I get a blank message box with just an OK button. How can I change this to read something different? I have no event handler...
1
6952
by: Arpan | last post by:
I use VB.NET to create ASP.NET applications. To display a message box in a VB app, one can use MsgBox. But when I used MsgBox while editing an ASPX page, the following error was generated: ...
9
3414
by: Ivan Jericevich | last post by:
In my code below at the line 'response' a blip sound is heard and the program exits the sub -- No MsgBox is displayed. What am I doing wrong? If nonNumberEntered = True Then msg = "Enter...
4
3167
by: rzito | last post by:
I am looking for a technique with regards to the message displayed when you enter text into a numeric field. I obviously get the "The value entered isn't valid for this field" message how do I...
3
2309
by: Adam Sandler | last post by:
Hello, I'm converting this code from VB: Try With serialPort ' snip End With Catch ex As Exception MsgBox(ex.ToString)
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
738
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.