Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    225
    Thanks
    2
    Thanked 0 Times in 0 Posts

    ASP error when upgrading to SQL Server

    Hello,

    I upgraded an ASP web site to SQL Server 2000 from MS Access. Everything else works fine, except one page. I think this function causes the error.

    I have been trying to figure out but could not.

    [code]
    function checkUser()
    checkUser("user")
    If isAdmin = true Then
    Else
    getUser(strUser)
    If Len(user_firstname) > 0 Then
    Session("idea") = "You are not authorized."
    response.redirect(erpg)
    End If
    End If
    End function

    Is there any wrong with this function? and how do I fix it to get it worked?

    Thanks.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,650
    Thanks
    80
    Thanked 4,638 Times in 4,600 Posts
    I don't see how that function ever worked.

    The first line of the function calls the function again.

    So now you come to the function again and...the first line of the function calls the function again.

    So now you come to the function again and...the first line of the function calls the function again.

    ...

    Forever. Well, until you run out of computer memory. Then, kablooey.

    So I don't think you have shown us the actual code. Did you truly copy/paste that directly from the ASP page?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    225
    Thanks
    2
    Thanked 0 Times in 0 Posts
    This is the actual function, not the whole page code. It works in ms Access but din't work on sql server. It is a long code so I just posted the function.

    Thanks.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,650
    Thanks
    80
    Thanked 4,638 Times in 4,600 Posts
    I'm sorry, but any attempt I would make to use that code as you posted it WOULD end up in either an error message or infinite recursion (and thus cause an error in a few milliseconds).

    Heck, just this much ASP code will crash it:
    Code:
    <%
    Function checkUser( )
        checkUsert("user")
    End Function
    
    Call checkUser()
    %>
    That gives the error message
    Code:
    Microsoft VBScript runtime error '800a000d'
    
    Type mismatch: 'checkUsert'
    
    /DearAbby/junk2.asp, line 3
    So I don't pretend to understand how that code could possibly have EVER worked. The database is irrelevant. The code, as you posted it, won't even compile.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •