PDA

Click to See Complete Forum and Search --> : basic msgbox question


MetallicaD
Feb 15th, 2001, 12:40 PM
Hi all, i am a pretty avid VB programmer and am trying to break into vbscript.. im trying a few tutorials but am having a problem with msgbox function..

when the page runs.. everything else loads, i just get this error message:

Permission denied: 'MsgBox'


why is permission denied, how do i get around this.

thanks in advance

alexmac
Feb 15th, 2001, 01:55 PM
Are you using this on an ASP page?
I could be wrong about this but Im not sure the msgbox function is integrated in ASP.
It might be because ASP scripts are processed server side and then sent to client in HTML format and msgbox docent exist in HTML.
The ASP code couldnt just wait for a user response like vb does. Still thats my thoughts - anyone know for sure?

You could use the Javascript alert("hello") to accomplish some of the stuff you can with msgbox.

Alex

MetallicaD
Feb 15th, 2001, 02:08 PM
alexmac:
first, thanks for the reply.. the reason i was using msgbox in asp coding is because a tutorial on another site had it..so i was just trying it.. I am pretty sure it is possible, considering vbscript does have a msgbox function.. it does seem kinda silly though to have the browser wait for the user to transfer control back..

-matt

alexmac
Feb 15th, 2001, 02:16 PM
Yes I take your point about vbscript having the msgbox function but it would make sense for ASP pages not to support it as the server processes a page and then sends it. There is no waiting around for a response.

Let me know if asp does support it through

Alex

da_silvy
Feb 15th, 2001, 02:30 PM
try declaring it as normal vbscript... i.e

<script language="vbscript">
MsgBox "hello"
</script>

Just a thought... I had problems with this too...

Oh well, Good Luck ;)

alexmac
Feb 15th, 2001, 02:46 PM
Cool that works. Sorry MetallicaD thought you were trying to do this in ASP from the error message.

Alex

Cander
Feb 16th, 2001, 11:27 AM
2 things. using MSgBx will not work in ASP because it would only show up on the server if it did.

da_silvy's example will not work in netscape

da_silvy
Feb 21st, 2001, 05:40 AM
but it will work in IE though?

JoshT
Feb 21st, 2001, 08:36 AM
Begin Useless Info

The MsgBox can't work on a server because the web server is running in the context of something like System or Anonymous Web User and doesn't actually have a desktop to display the MsgBox to.

End Useless Info

It should work on client side VBscript in IE because it's the VBScript equivalent to Javascript's alert.

Josh

Mark Sreeves
Feb 21st, 2001, 08:41 AM
I realise that you are just donig a few tutorials but...

Personally I think you should use Javascript on the client side so your pages are accesable to more people.