1
votes

Microsoft VBScript compilation error '800a03ea'
Syntax error
/decal/sslpdecal_inc/login.asp, line 26
Function DealerDecrypt(ByVal cString)
^

My full decrypt funticon is as

<%
    Function DealerDecrypt(ByVal cString)
        Dim cNewString
        Dim nOffset
        Dim nCharCode
        Dim cNewChar
        Dim i
        nOffset = -1
        For i = 1 To Len(cString)
            nCharCode = Asc(Mid(cString, i, 1))
            nCharCode = nCharCode + (nOffset)
            cNewChar = Chr(nCharCode)
            cNewString = cNewString & cNewChar
            nOffset = nOffset - 1
            If nOffset = -11 Then nOffset = -1
        Next
        DealerDecrypt = cNewString
    End Function 
%>

I had created one sample name as Getsample.asp with this function and is working well in that but when putting same function in pagename login.asp I am getting this error.

The only difference between this 2 page is Getsample.asp I have head, body tag both and in Login.asp page I have only body tag.

3
@GiladGreen done - user2977985
There's no syntax error in the code you posted. - Ansgar Wiechers
@AnsgarWiechers then why I am getting error. I have 2 pages in 1 page i m getting error and on second page i m not getting error - user2977985
@Xtremcool Bit of a guess but is that an #include? If so, it's likely the error is in the parent page. When an #include is added in an ASP page it's just like stitching the two scripts together, so check above and below where you add the #include as the problem will be there. Better yet, edit the question to show the ASP page code for the parent login.asp. - user692942

3 Answers

2
votes

I was able to reproduce it by placing an invalid character at the start of the Function definition, the likelihood is you have an invisible character instead of spaces or tabs that the VBScript runtime doesn't like.

<%
.   Function DealerDecrypt(ByVal cString)
        Dim cNewString
        Dim nOffset
        Dim nCharCode
        Dim cNewChar
        Dim i
        nOffset = -1
        For i = 1 To Len(cString)
            nCharCode = Asc(Mid(cString, i, 1))
            nCharCode = nCharCode + (nOffset)
            cNewChar = Chr(nCharCode)
            cNewString = cNewString & cNewChar
            nOffset = nOffset - 1
            If nOffset = -11 Then nOffset = -1
        Next
        DealerDecrypt = cNewString
    End Function 
%>

Produces the following error

Microsoft VBScript compilation error '800a03ea'

Syntax error

/test16.asp, line 6

.    Function DealerDecrypt(ByVal cString)  
-----^

While yours doesn't show a specific character, note how it points at the start of the function as the cause of the error. I would clear all the characters from the start of Function and then re-apply any indentation using your preferred method, spaces/tabs.

0
votes

Hi the issue is resolved

the login.asp was a child page of index.asp.

On index.asp page the code was written as below which was calling different page.

<!-- #include file="xxxx/xxxx.asp" -->

and like this internally it was calling login.asp page.

So on putting function on parent page it worked.

0
votes

I had the same problem and putting the include statement in the beginning of the file worked for me