FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Thu Mar 23, 2017 05:52 PM
Actually you do not even have to open RowSet.
You can directly save the result of SQL statement to DBF.
Important: You should link DBFCDX to the application.

Sample:
Code (fw): Select all Collapse
   cSql  := "SELECT FIRST,CITY,AGE,SALARY FROM customer"
   oCn:SaveToDBF( cSql, "c:\fwh\samples\custpart.dbf" )

   USE c:\fwh\samples\custpart NEW SHARED VIA "DBFCDX"
   XBROWSER "custpart"


The entire execution is extremely fast.
Note: This creates a new DBF file.
Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Thu Mar 23, 2017 07:35 PM

Thanks Rao,
I can't use oRs:savetodbf() because I need to do in a cycle like the example above.
Maurizio

Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Thu Mar 23, 2017 07:55 PM
Maurizio,

IF you really needs to do this in a cycle, I think you could to do by this way:

Code (fw): Select all Collapse
aValues := oCn:Execute(cString)
FOR n = 1 TO Len(aValues)
      oCn:Insert(cTable,,aValues[n])    
NEXT
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 12:25 AM
Code (fw): Select all Collapse
   do while !oRs:Eof()
      (cAlias)->( DBAPPEND() )
      (cAlias)->( AEVAL( oRs:Scatter( .t. ), { |u,i| FieldPut( i, u ) } ) )
      oRs:Skip( 1 )
   enddo


OR

Code (fw): Select all Collapse
   nFieldCount := oRs:FCount()
   do while !oRs:Eof()
      (cAlias)->(DBAPPEND())
      for n := 1 to nFieldCount
         (cAlias)->( FieldPut( n, oRs:FieldGet( n ) ) )
      next
      oRs:Skip( 1 )
   enddo
Regards



G. N. Rao.

Hyderabad, India
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 01:24 AM
Dear Mr.Rao,

WIll it be compatible with BCC7?
nageswaragunupudi wrote:For MSVC32 Users


If the MSVC32 application is linked with mysqlclient.lib instead of with libmysql32.lib, the exe works independently and does not require libmysql.dll. You can distribute the exe only without any dlls.

Thanks.
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 01:25 AM

No
Only MSVC32.
But the Exe will be too large.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 02:16 AM

Thank you, Mr.Rao.

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 08:52 AM

Thanks Rao ,

Just what I wanted :D .

It's possible to have a list of the methods of RowSet class ?

Regards Maurizio

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 10:42 AM
Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 03:40 PM

Thanks Rao ,

I have a loop that every 60 minutes connecting to a server

FWCONNECT oCn HOST cServer USER cUser PASSWORD cPassword

I read the new data and i close .

oCn:Close()

Sometimes I get this error :
2013 Lost connection to MySQL server at 'waiting for initial comunication packet' ,system error 2 .

it's possible not view the message and write in a log ?

Regards Maurizio

Regards Maurizio

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 04:51 PM

I understand you already know the use of oCn:lShowErrors and oCn:lLogErr.

Normally no errors or other messages are either displayed or logged unless you explicitly set the above flags.

But we thought some messages about losing connection are very important to the user to know what is happening or why data is not being saved, etc. For this reason we are displaying some connection related error messages compulsorily. We expect such messages would help the user to check his cables/internet connections etc and continue the program.

Let us consider an option to suppress these messages also in specific cases like yours. Your requirement is just in time before the next release.

Setting oCn:lLogErr to .t. anyway logs all error messages including this message

Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 05:00 PM

Thanks Rao ,

but in this case the error is when I connect , lLogErr it should be in

FWCONNECT oCn HOST cServer USER cUser PASSWORD cPassword

Maurizio

Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Fri Mar 24, 2017 07:55 PM

I see.
Let me think.

In the meantime better we also look for avoiding this error.
clean up you temporary folder. (try)

Regards



G. N. Rao.

Hyderabad, India
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Sat Mar 25, 2017 12:02 PM

Instead of

FWCONNECT oCn HOST cServer USER cUser PASSWORD cPassword

Please try
oCn := maria_Connect( cServer, nil, cUser, cPassword, .F. )

This would suppress display of error messages while connecting

Regards



G. N. Rao.

Hyderabad, India
Posts: 842
Joined: Mon Oct 10, 2005 01:29 PM
Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )
Posted: Mon Mar 27, 2017 10:05 AM

Hello Rao ,

I have the same message with

oCn := maria_Connect( cServer, nil, cUser, cPassword, .F. )

I use FW January 2017 :cry:

Maurizio