Announcement

Collapse
No announcement yet.

SQL Database cannot save..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SQL Database cannot save..

    Hello guys i am having trouble with saving all the values of inputs into database i got some error when calling the addRecords function

    Thanks in advance for the help.
    Attached Files

  • #2
    Hi Telco,
    I think you have problem whith success condition.
    Currently, it appears normal that you have this message.

    Comment


    • #3
      Hi I think you have type of massage then typeofmassage one with spaces one without
      Cheers

      Comment


      • #4
        Thanks colc,, you are correct.. Thanks for the help....

        Comment


        • #5
          no probs cheers

          Comment


          • #6
            Thank you again...

            Comment


            • #7
              --para guardar en bd un ejemplo seria algo asi

              --audio al dar clikc
              Audio.Load(CHANNEL_NARRATION, "AutoPlay\\Audio\\Notificacion.ogg", true, false);

              function Escape (sSourceString)
              sSourceString = String.Replace(sSourceString, "'", "''", false);
              return sSourceString;
              end

              --$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$
              --$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$
              --$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$




              INIFile.SetValue("AutoPlay\\Docs\\Registro.ini", TiposDeHistorial[Tipo], "Historial "..sTipo[Tipo], Input.GetText("Input_NumeroRecibo"));
              sTipo[Tipo] = (sTipo[Tipo])+1;



              --$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$


              -- Obtener información de los objetos de entrada y almacenar
              -- En las variables de transferir a la base de datos



              sNumeroRecibo = Input.GetText("Input_NumeroRecibo");
              sApellidosNombres = Input.GetText("Input_ApellidosNombres");
              sDni = Input.GetText("Input_Dni");
              sCodigoPuesto = Input.GetText("Input_CodigoPuesto");
              sCategoriaPuesto = ComboBox.GetText("ComboBox_CategoriaPuesto");
              sDependencia = ComboBox.GetText("ComboBox_Dependencia");
              sRetribucion = ComboBox.GetText("ComboBox_Retribucion");
              sFechaRetribucion = Input.GetText("Input_FechaRetribucion");
              sEncargado = ComboBox.GetText("ComboBox_Encargado");
              sCobrador = ComboBox.GetText("ComboBox_Cobrador");



              --SI ESTAMOS CREANDO UN NUEVO REGISTRO, INSERTAR EN LOS PRÓXIMOS DISPONIBLES
              --POSICIÓN, DE LO CONTRARIO INSERTAR EN LA POSICIÓN DEL REGISTRO ACTUAL



              if bNewRecord then
              nSelection = SQLite.QueryToTable(db,"SELECT * FROM Info_List WHERE ApellidosNombres='"..sApellidosNombres.."'");
              if nSelection == nil then -- Si no hay registros con el mismo Nombre y Apellidos inserta los datos
              SQLite.Query(db,"insert into Info_List values(NULL, '"..sNumeroRecibo.."', '"..sApellidosNombres.."', '"..sDni.."', '"..sCodigoPuesto.."', '"..sCategoriaPuesto.."', '"..sDependencia.."', '"..sRetribucion.."', '"..sFechaRetribucion.."', '"..sEncargado.."', '"..sCobrador.."' )");
              if Application.GetLastError() ~= SQLite.OK then
              Dialog.Message("Error: " .. nLastError, SQLite.GetLastErrorString());
              else
              Dialog.TimedMessage("Registro-Aportador", "Estimado(a) "..sUsuario.." Se Registro la Información del Aportador con Éxito", 3000, MB_ICONEXCLAMATION);
              Page.Jump("Rpd")

              end
              else -- Si hay registros con el Nombre y Apellidos entonces...
              nData = nil;
              rData = nil;
              for nRow = 1, nSelection.Rows do
              nData = nSelection.Data[nRow]["FechaRetribucion"];
              if nData == sFechaRetribucion then
              rData = true;
              break
              end
              end

              if not rData then
              SQLite.Query(db,"insert into Info_List values(NULL, '"..sNumeroRecibo.."', '"..sApellidosNombres.."', '"..sDni.."', '"..sCodigoPuesto.."', '"..sCategoriaPuesto.."', '"..sDependencia.."', '"..sRetribucion.."', '"..sFechaRetribucion.."', '"..sEncargado.."', '"..sCobrador.."' )");
              if Application.GetLastError() ~= SQLite.OK then
              Dialog.Message("Error: " .. nLastError, SQLite.GetLastErrorString());
              else
              Dialog.TimedMessage("Registro-Aportador", "Estimado(a) "..sUsuario.." Se Registro la Información del Aportador con Éxito", 3000, MB_ICONEXCLAMATION);
              Page.Jump("Rpd")

              end
              else
              Dialog.Message("Error", "Este rentador ya aporto en esta fecha ");
              end
              end
              else
              SQLite.Query(db,"insert or replace into Info_List values('" .. nRecordID .."', '"..sNumeroRecibo.."', '"..sApellidosNombres.."', '"..sDni.."', '"..sCodigoPuesto.."', '"..sCategoriaPuesto.."', '"..sDependencia.."', '"..sRetribucion.."', '"..sFechaRetribucion.."', '"..sEncargado.."', '"..sCobrador.."' )");
              nLastError = Application.GetLastError();
              if nLastError ~= SQLite.OK then
              Dialog.Message("Error: " .. nLastError, SQLite.GetLastErrorString());

              Page.Jump("Rpd")


              end
              end

              Comment

              Working...
              X
              😀
              🥰
              🤢
              😎
              😡
              👍
              👎