Estou a utilizar o SQL para uma página em ASP clássico e numa parte do código tenho isto:
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
Quando executo estou a obter o seguinte erro:
Microsoft VBScript compilation error '800a0401'
Expected end of statement
/GIP-eP/Formacao/passaportes/gravapassaporte.asp, line 234
SQL = "UPDATE FO_Passaportes SET creditoTotal = creditoTotal - " & Abs(credito) & " WHERE IDPassaporte = " & ID Passaporte & ""----------------------------------------------------------------------------------------------------------------^
O erro está a apontar para a minha ultima query:
If (opcao = 2) Then
SQL = "UPDATE FO_Passaportes SET creditoTotal = creditoTotal - " & Abs(credito) & " WHERE IDPassaporte = " & ID Passaporte & ""
End If
O que estou a fazer de mal??
ID Passaporte