Consulta usando TDataRow con FWmariaconnection

Post Reply
User avatar
MarioG
Posts: 1356
Joined: Fri Oct 14, 2005 1:28 pm
Location: Resistencia - Chaco - AR

Consulta usando TDataRow con FWmariaconnection

Post by MarioG »

Hola Gente!

Intento guardar (insertar) un registro asignado Datas mediante TDataRow, desde un Query del que tomo todos _.
Luego de asignar datos, a todos _, excepto, obvio, al id incremental, para luego guardar; recibo el alerta: -1 Record not found
Al observar lo guardado; todos los datos estan correctamente asignados
Que me dice tal mensaje?

Esta es la tabla:

Code: Select all

   "CREATE TABLE IF NOT EXISTS movcuenta ("  + ;
            "id              MEDIUMINT(7) UNSIGNED ZEROFILL AUTO_INCREMENT PRIMARY KEY," + ;
            "id_cliprv       MEDIUMINT(7) UNSIGNED ZEROFILL NOT NULL," + ;
            "FeAsiento       DATE,"                                    + ;
            "HhAsiento       TIME DEFAULT '00:00:00',"  + ;
            "CompNro         CHAR(13) NOT NULL,"                       + ;
            "Detalle         VARCHAR(100),"                            + ;
            "Monto           DECIMAL(10,2) NOT NULL,"                  + ;
            "IdPagoTipo      TINYINT(1) UNSIGNED ZEROFILL NOT NULL,"   + ;
            "id_Concepto     TINYINT(2) UNSIGNED NOT NULL,"            + ;
            "id_banco        SMALLINT(3) UNSIGNED ZEROFILL NOT NULL,"  + ;
            "id_cuenta       SMALLINT(5) UNSIGNED ZEROFILL NOT NULL,"  + ;
            "EsCta3ro        BIT,"                                     + ;
            "id_user         TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,"  + ;
            ; // Indices
            "INDEX           Acreditado (FeAsiento) )" + ;
            "COMMENT=        'Movimientos Actuales',"     + ;
            "ENGINE=         INNODB,"                     + ;
            "COLLATE=        latin1_spanish_ci,"          + ;
            "DEFAULT CHARSET=latin1;"
Gracias!
Resistencia - "Ciudad de las Esculturas"
Chaco - Argentina
User avatar
MarioG
Posts: 1356
Joined: Fri Oct 14, 2005 1:28 pm
Location: Resistencia - Chaco - AR

Re: Consulta usando TDataRow con FWmariaconnection

Post by MarioG »

Gracias igual
He encotrado el error
El Query estaba escrito de manera incorrecta:

Code: Select all

::oConn:RowSet( "SELECT * FROM movcuenta WHERE id_concepto="+FW_ValToSQL(_IDABRECJA)+" AND FeAsiento="+FW_DT2STR( Date() ) )
Forma correcta:

Code: Select all

::oConn:RowSet( "SELECT * FROM movcuenta WHERE id_concepto="+FW_ValToSQL(_IDABRECJA)+" AND FeAsiento='"+FW_DT2STR( Date() )+"'" )
Resistencia - "Ciudad de las Esculturas"
Chaco - Argentina
Post Reply