Out of necessity, I had to start modifying an asp page which is where I'm running into difficulty. (My previous experience is with php and javascript which I'm very comfortable with.) I keep getting the following error: Microsoft VBScript runtime error '800a000d' Type mismatch: 'Check_Errors' It seems to be due to the MsgBox. If I comment out the MsgBox line, it runs fine. I want to be able to have the message box though. Could you let me know what's wrong with it? <% if Session("Verified") <> "Y" then Response.Redirect "login.asp" end if %> <script language="vbscript"> <!-- Sub Check_Errors() Dim rstHEX_Error Dim DataConn Dim sqlSelect Dim sSCACCode Dim sResult Set DataConn = Server.CreateObject("ADODB.Connection") DataConn.Open(Session("ConString")) 'sSCACCode = rstHEX_Login("UserSCAC") sSCACCode = "ZXCV" sqlSelect = "SELECT * FROM HEX_Error WHERE SCAC = '" & sSCACCode & "' AND ErrorAckd = 'N'" set rstHEX_Error = DataConn.Execute(sqlSelect) If NOT rstHEX_Error.eof Then Response.Write "Errors Found" 'Response.End 'sResult = msgbox ("214 were in error please visit the 824 Error screen to acknowledge\view the errors",vbExclamation, "Confirm") End If End Sub --> </script> <HTML> <title>Main Menu</title> <BODY> <% Call Check_Errors()%> <P><A href="214Add.asp"><FONT face=sans-serif>View 214 Transactions </FONT> </A><FONT face=sans-serif> </FONT> </P> <P><A href="214Add.asp"><FONT face=sans-serif>Add 214 Transactions </FONT> </A></P> <P><A href="logout.asp"><FONT face=sans-serif>Log Out</FONT> </A></P> </BODY></HTML> Code (markup):
msgbox not supported asp I do not understand what you are trying to do. if do you want to use msgbox use javascript alert('<%=xx%>') function. sub procedures must be used with <% sub .....%> in asp
you can use the message box function but you can you this function created and used by me 'message box function msg_box(s_message) Response.Write "<script language=javascript>" Response.Write "alert(""" & s_message & """);" Response.Write "</script>" end function Remember to add response.end at the end Ranjan
ASP pages all execute serverside, IIRC. The code the OP pasted is meant for use on a local machine, ie, vbscript run directly on a Windows box. The ASP processor of IIS doesn't have support for the msgbox function. Pharmacy's Javascript solution should do the trick, though.