FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Thu Mar 23, 2017 5: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: Select all  Expand view  RUN

   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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby Maurizio » Thu Mar 23, 2017 7:35 pm

Thanks Rao,
I can't use oRs:savetodbf() because I need to do in a cycle like the example above.
Maurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby vilian » Thu Mar 23, 2017 7:55 pm

Maurizio,

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

Code: Select all  Expand view  RUN

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
User avatar
vilian
 
Posts: 978
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Fri Mar 24, 2017 12:25 am

Code: Select all  Expand view  RUN
  do while !oRs:Eof()
      (cAlias)->( DBAPPEND() )
      (cAlias)->( AEVAL( oRs:Scatter( .t. ), { |u,i| FieldPut( i, u ) } ) )
      oRs:Skip( 1 )
   enddo
 


OR

Code: Select all  Expand view  RUN
  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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby dutch » Fri Mar 24, 2017 1: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 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Fri Mar 24, 2017 1:25 am

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

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby dutch » Fri Mar 24, 2017 2:16 am

Thank you, Mr.Rao.
Regards,
Dutch

FWH 19.01 / 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)
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby Maurizio » Fri Mar 24, 2017 8:52 am

Thanks Rao ,

Just what I wanted :D .

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

Regards Maurizio
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Fri Mar 24, 2017 10:42 am

Regards

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

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby Maurizio » Fri Mar 24, 2017 3: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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Fri Mar 24, 2017 4: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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby Maurizio » Fri Mar 24, 2017 5: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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » Fri Mar 24, 2017 7: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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby nageswaragunupudi » 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
User avatar
nageswaragunupudi
 
Posts: 10643
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH 16.08 : Built-in MySql/MariaDB functionality (Updated )

Postby Maurizio » 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
User avatar
Maurizio
 
Posts: 824
Joined: Mon Oct 10, 2005 1:29 pm

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 32 guests