Error: Expected End of Statement [closed]

1

I'm using SQL for a classic ASP page and in a part of the code I have this:

            If (opcao = 1) Then
        If credito > 0 Then
            SQL = "UPDATE FO_Passaportes SET creditoTotal = creditoTotal + " & credito & " WHERE IDPassaporte = " & IDPassaporte & ""
        Else
            SQL = "UPDATE FO_Passaportes SET creditoUsado = creditoUsado + " & Abs(credito) & " WHERE IDPassaporte = " & IDPassaporte & ""
        End If
        End If
        If (opcao = 2) Then
            SQL = "UPDATE FO_Passaportes SET creditoTotal = creditoTotal - " & Abs(credito) & " WHERE IDPassaporte = " & ID Passaporte & ""
        End If

When I run I am getting the following error:

  

Microsoft VBScript compilation error '800a0401'

     

Expected end of statement

     

/GIP-eP/Formation/passports/overpassport.asp, line 234

     

SQL="UPDATE FO_Passports SETTotal credit = Total credit -" & Abs (credit) & "WHERE IDPassport=" & ID Passport & "------------------------------------------------ -------------------------------------------------- -------------- ^

The error is pointing to my last query:

        If (opcao = 2) Then
        SQL = "UPDATE FO_Passaportes SET creditoTotal = creditoTotal - " & Abs(credito) & " WHERE IDPassaporte = " & ID Passaporte & ""
    End If

What am I doing wrong ??

    
asked by anonymous 26.06.2017 / 17:13

1 answer

2

There is a space here ID Passaporte , the right is IDPassaporte .

The code in general is confusing and can be simplified, which helps to identify these problems more.

    
26.06.2017 / 17:17