FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Error with MariaDB and DataRow
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Error with MariaDB and DataRow
Posted: Wed May 22, 2024 09:25 AM
Hello Rao,
I use MariaDB and DataRow and I get an error when I add a record in filtered recordsource
CUSTID (in the example) is incorrect.
Maybe I use the commands incorrectly but with ADO it works correctly.
Code (fw): Select all Collapse
#include "fivewin.ch"

static aStr := { "208.91.198.197:3306,fwhdemo,gnraofwh,Bharat@1950", ;
                 "209.250.245.152,fwh,fwhuser,FiveTech@2022" }

static oCn

//----------------------------------------------------------------------------//

function Main()

   local oRs, cSql,oRec

   FWSetLanguage( 1 )
   FW_SetUnicode( .t. )

   if ( oCn := maria_Connect( aStr[ 1 ], .t. ) ) != nil

      TEXT INTO cSql
         SELECT C.ID AS CustID, C.FIRST AS CustName, C.AGE AS AG, C.STATE AS ST, S.NAME AS StateName
         FROM customer C
         LEFT OUTER JOIN states S ON C.STATE = S.CODE
         ORDER BY CUSTID
      ENDTEXT

      oRs   := oCn:RowSet( cSql )

     // xbrowse(oRs)  
      
      oRec  := TDataRow():New( oRs, nil, .t.)
      oRec:CUSTNAME := 'PIPPO'
      oRec:Save()
      ? 'Last CUSTID :'  + str(oRec:CUSTID ) + '* OK *' + ' Name:' + oRec:CUSTNAME
      
      
      oRs:Filter = "CUSTNAME = 'Tom'" 
      xbrowse(oRs) 
       
      oRec  := TDataRow():New( oRs, nil, .t.)
      oRec:CUSTNAME := 'Frank'
      oRec:Save()
      ? 'Last CUSTID :'  + str(oRec:CUSTID ) + '* ERROR  *' + ' Name:' + oRec:CUSTNAME
        
      
      
      
      
      
     /*
      XBROWSER oRs FASTEDIT AUTOSORT AUTOFIT SHOW RECID ;
         TITLE "Compare Editability Vs Other Libs" ;
         SETUP ( oBrw:lFastEdit := .f., oBrw:aCols[ 4 ]:cEditPicture := "@!" )
     */
      oCn:Close()

   endif

return nil
Regards Maurizio
www.nipeservice.com
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: Error with MariaDB and DataRow
Posted: Tue Jun 04, 2024 09:59 AM

Hello RAO

could you see this post?

Maurizio

Posts: 114
Joined: Fri Jul 21, 2006 07:15 PM
Re: Error with MariaDB and DataRow
Posted: Tue Jun 04, 2024 03:04 PM
Maurizio, I do not use tDataRow(), but it works for me:
Code (fw): Select all Collapse
oRec := oRs:Record( .F. ) // or .T. to insert
Wouldn't that be missing?

Regards.
FWH / xHarbour / BCC / MySql

Visual Studio / Harbour / DotNet Maui / C#
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Error with MariaDB and DataRow
Posted: Thu Jun 06, 2024 04:04 PM
Code (fw): Select all Collapse
oRec := oRs:Record( .F. ) // or .T. to insert
and
Code (fw): Select all Collapse
oRec  := TDataRow():New( oRs, nil, .t.)// .t. or .f.
are same.
Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Error with MariaDB and DataRow
Posted: Thu Jun 06, 2024 04:04 PM

We will test and get back

Regards



G. N. Rao.

Hyderabad, India
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Error with MariaDB and DataRow
Posted: Thu Sep 04, 2025 02:00 PM

Dear All ,

Is this resolved ?

Thanks

Shridhar

Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Error with MariaDB and DataRow
Posted: Fri Sep 05, 2025 10:43 AM

Hi,

aren't fw mysql servers working?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 336
Joined: Mon Dec 07, 2009 02:49 PM
Re: Error with MariaDB and DataRow
Posted: Sat Sep 06, 2025 10:14 AM

Hi ,

I want to use DataRow class to save multiple records in batch mode. However, I'm not sure if DataRow actually supports batch operations.

I came across this topic and wanted to check if there are any known issues or limitations with using DataRow in this context.

Appreciate any insights you can share.

Thanks

Shridhar

Thanks

Shridhar

FWH 24.04, BCC 7 32 bit, MariaDB
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error with MariaDB and DataRow
Posted: Sat Sep 06, 2025 01:16 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion