0
When I’m gonna make a Update
on the table Impressora
my program is closing itself, while debugging the program the following error has been accused:
My Update is this way:
begin
if cdsImpressora.state in[dsedit] then
begin
dmDatabase.SQLConnection.Execute('UPDATE Impressoras SET '+
' PATRIMONIO ='''+ cdsImpressoraPATRIMONIO.AsString+''','+
' PATRIMONIOBANDEJA = '''+ cdsImpressoraPATRIMONIO.AsString+''','+
' PATRIMONIODUPLEX = '''+ cdsImpressoraPATRIMONIODUPLEX.AsString +''','+
' PATRIMONIOMAILBOX = '''+ cdsImpressoraPATRIMONIOMAILBOX.AsString +''','+
' NUMEROIP = '''+ cdsImpressoraNUMEROIP.AsString + ''','+
' ENDERECOEXTERNO = '''+ cdsImpressoraENDERECOEXTERNO.AsString +''','+
' NUMERONF = '''+ cdsImpressoraNUMERONF.AsString +''','+
' NUMEROPORTA = '''+ cdsImpressoraNUMEROPORTA.AsString+''','+
' NUMEROSERIE ='''+ cdsImpressoraNUMEROSERIE.AsString+''','+
' SENHA = ''' + cdsImpressoraSENHA.AsString+''','+
' USUARIO = ''' + cdsImpressoraUSUARIO.AsString+''','+
' CAMINHO = ''' + cdsImpressoraCAMINHO.AsString+''','+
' SETORINSTALACAO ='''+ cdsImpressoraSETORINSTALACAO.AsString+ ''',' +
' CODIGOMODELO = ' + cdsImpressoraCODIGOMODELO.AsString+ ',' +
' FRANQUIA = ' +iif(cdsImpressoraFRANQUIA.AsString='','0',cdsImpressoraFRANQUIA.AsString)+','+
' VALORIMPRESSAO = ' +iif(cdsImpressoraVALORIMPRESSAO.AsString='','0',TrocaVirgPPto(cdsImpressoraVALORIMPRESSAO.AsString))+','+
' TIPOPATRIMONIO = '''+cdsImpressoraTIPOPATRIMONIO.AsString + ''','+
' PATRIMONIOOUTRO = '''+cdsImpressoraPATRIMONIOOUTRO.AsString + ''','+
' VALORIMPRESSAOCOLOR = '+iif(cdsImpressoraVALORIMPRESSAOCOLOR.AsString='','0',TrocaVirgPPto(cdsImpressoraVALORIMPRESSAOCOLOR.AsString))+','+
' FRANQUIACOLOR = '+ iif(cdsImpressoraFRANQUIACOLOR.AsString='','0',cdsImpressoraFRANQUIACOLOR.AsString)+','+
' CORTESIAIMPRESSAO = '+iif(cdsImpressoraCORTESIAIMPRESSAO.AsString='','0',cdsImpressoraCORTESIAIMPRESSAO.AsString)+','+
' VALOREXCEDENTEIMPRESSAOCOLOR =' +iif(cdsImpressoraVALOREXCEDENTEIMPRESSAOCOLOR.AsString='','0',TrocaVirgPPto(cdsImpressoraVALOREXCEDENTEIMPRESSAOCOLOR.AsString))+','+
' VALORFIXOMENSAL = ' +iif(cdsImpressoraVALORFIXOMENSAL.AsString='','0',TrocaVirgPPto(cdsImpressoraVALORFIXOMENSAL.AsString))+','+
' VALOREXCEDENTEDIGITALIZACAO = '+iif(cdsImpressoraVALOREXCEDENTEDIGITALIZACAO.AsString='','0',TrocaVirgPPto(cdsImpressoraVALOREXCEDENTEDIGITALIZACAO.AsString))+','+
' VALORDIGITALIZACAO = '+iif(cdsImpressoraVALORDIGITALIZACAO.AsString='','0',TrocaVirgPPto(cdsImpressoraVALORDIGITALIZACAO.AsString))+ ','+
' STATUS = '+QuotedStr(cdsImpressorastatus.AsString)+','+
' FRANQUIADIGITALIZACAO = '+iif(cdsImpressoraFRANQUIADIGITALIZACAO.AsString='','0',TrocaVirgPPto(cdsImpressoraFRANQUIADIGITALIZACAO.AsString))+
' where CODIGO = '+cdsImpressoraCODIGO.AsString, nil);
end;
end;
cdsImpressora.Close;
sdsImpressora.CommandText := 'select * from Impressoras where codigo = 0' ;
cdsImpressora.Open;
MostraFila(0);
And my table impressora
is configured as follows:
If you have any idea what might be happening. For to insert the error in the bank does not occur.
Most likely one of your entire fields is empty. And I see that you have not yet learned to use Quotedstr.
– Pablo Tondolo de Vargas