Page 1 of 1
FiveWin & MySql
Posted: Thu Jul 24, 2014 1:23 pm
by avista
Hi all,
I am planing to test MySql database with FiveWin,
Please information which is the best version of MySql
and if possible link where to download it from
Best Regards,
Re: FiveWin & MySql
Posted: Thu Jul 24, 2014 1:31 pm
by elvira
Hello Avista,
I recomend to you to use ADO and TDataRow class. There are many samples on the fórum.
This is a recent one:
Code: Select all
#include "fivewin.ch"
#include "adodef.ch"
#include "xbrowse.ch"
function Main()
local oCn, oRs
local oWnd, oFont, oBrw, oMiSort
SET DATE ITALIAN
SET CENTURY ON
oCn := FW_OpenAdoConnection( "c:\fwh\samples\" )
oRs := FW_OpenRecordSet( oCn, "SALES" )
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-14
DEFINE WINDOW oWnd TITLE "DBF TABLE THROUGH ADO"
oWnd:SetFont( oFont )
DEFINE BUTTONBAR oWnd:oBar SIZE 100,32 2010
DEFINE BUTTON OF oWnd:oBar PROMPT "Add" ACTION oBrw:Edit( .t. )
DEFINE BUTTON OF oWnd:oBar PROMPT "Edit" ACTION oBrw:Edit()
DEFINE BUTTON OF oWnd:oBar PROMPT "Delete" ACTION oBrw:Delete()
DEFINE BUTTON OF oWnd:oBar PROMPT "Report" ACTION oBrw:Report()
DEFINE BUTTON OF oWnd:oBar PROMPT "Close" ACTION oWnd:End()
SET MESSAGE OF oWnd TO "" 2010
DEFINE MSGITEM oMiSort PROMPT If( Empty( oRs:Sort ), "NATURAL", oRs:Sort ) ;
SIZE 200
oMiSort:bMsg := { || If( Empty( oRs:Sort ), "NATURAL", oRs:Sort ) }
@ 0,0 XBROWSE oBrw OF oWnd DATASOURCE oRs ;
AUTOCOLS AUTOSORT CELL LINES NOBORDER FOOTERS
AEval( oBrw:aCols, { |o| If( o:cDataType == 'N', o:nFooterType := AGGR_SUM, nil ) } )
WITH OBJECT oBrw
:nEditTypes := EDIT_GET
:bLClickHeaders := { || oMiSort:Refresh() }
:MakeTotals()
//
:CreateFromCode()
END
oWnd:oClient := oBrw
ACTIVATE WINDOW oWnd
RELEASE FONT oFont
oRs:Close()
oCn:Close()
return nil
Re: FiveWin & MySql
Posted: Thu Jul 24, 2014 1:48 pm
by avista
Elvira,
Thaanks for reply,
Byt my basic question is:
Which is the best version of MySql
and if possible link where to download it from
Regards,
Re: FiveWin & MySql
Posted: Thu Jul 24, 2014 2:38 pm
by LordJonas
Hi....
Regarding the "best version of MySQL" the answer is simple: the lastest stable version...
The link is
http://dev.mysql.com/downloads/mysql/
But if you want a true "open-source" database why not give a try to
MariaDB ? It's even better than MySQL and it's really "open-source"
https://downloads.mariadb.org/
Regards,
João Ferreira
Re: FiveWin & MySql
Posted: Fri Jul 25, 2014 10:52 am
by Jack
Hi,
Could you post a connection string (ado) with MySql .
Should we install an ODBC driver for MySql , witch one , 32 or 64 bits ?
Thanks a lot .
Re: FiveWin & MySql
Posted: Fri Jul 25, 2014 11:12 am
by anserkk
Jack wrote:Could you post a connection string (ado) with MySql .
cConnectionString := "Driver={MySQL ODBC 5.3 Unicode Driver};Server=
YourServersIP;Port=3306;Database=
YourDatabseName;User=
YourUserName;Password=
YourPassword;Option=3;"
Jack wrote:
Should we install an ODBC driver for MySql , witch one , 32 or 64 bits ?
Yes, You should install ODBC Driver for MySQL
Re: FiveWin & MySql
Posted: Fri Jul 25, 2014 11:54 am
by Jack
Thanks for this answer .
For the ODBC, we have only to install it, not configure in the ODBC Screen ?
Odbc 32 or 64 bits ?
Could you post a link ?
Thanks
Re: FiveWin & MySql
Posted: Fri Jul 25, 2014 2:44 pm
by anserkk
Jack wrote:Thanks for this answer .
For the ODBC, we have only to install it, not configure in the ODBC Screen ?
Odbc 32 or 64 bits ?
Could you post a link ?
Thanks
You just have to install the ODBC connector for your OS (64 or 32 bit). There is nothing to configure.
Download link
http://dev.mysql.com/downloads/connector/odbc/