SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Microsoft VBScript runtime error '800a0005'

    Hi friends I am getting Error listed below


    Microsoft VBScript runtime error '800a0005'Invalid procedure call or argument: 'mid' /includedfiles/encriptdecript.asp, line 45



    Asp File It was running in server 2000 fine but i migrtaed server2003 it is not running giving error like this.

    I am using encrypt & decrypt in this page for employeers logon.

    I checked some what but not usefule.

    kindly rectify this error.

    Code is below:


    <%
    Public Function encript(pass)
    Dim temp, temp1
    Dim pos, leng, dt, tim
    Dim i, key
    leng = Len(pass)
    tim = Time
    tim = Mid(tim, 1, Len(tim) - 3)
    tim = Mid(tim, Len(tim) - 1, 2) * Int(Rnd * 100)
    For i = 1 To Len(CStr(tim))
    pos = pos + CInt(Mid(CStr(tim), i, 1))
    Next
    While pos > Len(pass)
    pos = pos Mod 10 + Int(Rnd * 10)
    If pos = 0 Then
    pos = Len(pass) + 1
    End If
    Wend
    If pos <= 2 Then
    pos = 3
    End If
    key = Int((255 - 150 + 1) * Rnd + 150)
    For i = 1 To Len(pass)
    If Asc(Mid(pass, i, 1)) > key Then
    temp = temp & Chr(CInt(Asc(Mid(pass, i, 1))) - key)
    ElseIf Asc(Mid(pass, i, 1)) < key Then
    temp = temp & Chr(key - CInt(Asc(Mid(pass, i, 1))))
    Else
    temp = temp & Chr(Asc(Mid(pass, i, 1)))
    End If
    Next
    temp1 = Mid(temp, 1, pos) & Chr(key)
    temp1 = temp1 & Mid(temp, pos + 1, Len(temp))
    temp = Chr(pos + 150) & temp1
    encript = temp
    End Function

    Public Function decript(pass)
    Dim pos, key, temp
    Dim i, temp1

    //error line

    pos = Int(Asc(Mid(pass, 1, 1))) - 150
    key = Asc(Mid(pass, pos + 2, 1))
    temp = Mid(pass, 1, pos + 1)


    pass = temp & Mid(pass, pos + 3, Len(pass))
    pass = Mid(pass, 2, Len(pass))
    For i = 1 To Len(pass)
    If Asc(Mid(pass, i, 1)) <> key Then
    temp1 = temp1 & Chr(key - CInt(Asc(Mid(pass, i, 1))))
    Else
    temp1 = temp1 & Chr(Asc(Mid(pass, i, 1)))
    End If
    Next
    decript = temp1
    End Function
    %>

  2. #2
    SitePoint Wizard siteguru's Avatar
    Join Date
    Oct 2002
    Location
    Scotland
    Posts
    3,631
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Code:
    pass = temp & Mid(pass, pos + 3, Len(pass))
    I suspect that this is actually line 45. And I suspect the cause of the problem is this:
    Code:
    pos = Int(Asc(Mid(pass, 1, 1))) - 150
    I wonder if it is the -150 that is causing pos to contain a negative number? (This would make the Mid() function return an error.
    Ian Anderson
    www.siteguru.co.uk

  3. #3
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The reason for the error is that you probably passing UNENCRYPTED VALUE or NULL VALUE to Decrypt function.

    Try response.write ("pass") in Decrypt function to see what value is passed to the function.
    Last edited by itHighway; Apr 13, 2011 at 07:58. Reason: added more details

  4. #4
    SitePoint Member
    Join Date
    Apr 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks For your reply..!

    But it is the same not working after made changes...


Bookmarks

Posting Permissions

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