Error with MariaDB and DataRow

Post Reply
User avatar
Maurizio
Posts: 844
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Error with MariaDB and DataRow

Post by Maurizio »

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: Select all | Expand

#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
User avatar
Maurizio
Posts: 844
Joined: Mon Oct 10, 2005 1:29 pm
Contact:

Re: Error with MariaDB and DataRow

Post by Maurizio »

Hello RAO
could you see this post?
Maurizio
User avatar
Eroni
Posts: 114
Joined: Fri Jul 21, 2006 7:15 pm
Location: Criciuma/SC Brazil
Contact:

Re: Error with MariaDB and DataRow

Post by Eroni »

Maurizio, I do not use tDataRow(), but it works for me:

Code: Select all | Expand

oRec := oRs:Record( .F. ) // or .T. to insert 
Wouldn't that be missing?

Regards.
FWH / xHarbour / BCC / MySql
Visual Studio / Harbour / DotNet Maui / C#
User avatar
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Error with MariaDB and DataRow

Post by nageswaragunupudi »

Code: Select all | Expand

oRec := oRs:Record( .F. ) // or .T. to insert
and

Code: Select all | Expand

oRec  := TDataRow():New( oRs, nil, .t.)// .t. or .f.
are same.
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
Posts: 10733
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: Error with MariaDB and DataRow

Post by nageswaragunupudi »

We will test and get back
Regards

G. N. Rao.
Hyderabad, India
shri_fwh
Posts: 340
Joined: Mon Dec 07, 2009 2:49 pm

Re: Error with MariaDB and DataRow

Post by shri_fwh »

Dear All ,

Is this resolved ?

Thanks
Shridhar
Thanks
Shridhar
FWH 24.04, BCC 7 32 bit, MariaDB
vilian
Posts: 1068
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil
Contact:

Re: Error with MariaDB and DataRow

Post by vilian »

Hi,
aren't fw mysql servers working?
Sds,
Vilian F. Arraes
[email protected]
Belém-Pa-Brazil
shri_fwh
Posts: 340
Joined: Mon Dec 07, 2009 2:49 pm

Re: Error with MariaDB and DataRow

Post by shri_fwh »

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
User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Error with MariaDB and DataRow

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply