Page 1 of 3

FWH 17.03 : Using FWMARIADB for Embedded Server

Posted: Mon Mar 20, 2017 9:27 am
by nageswaragunupudi
It is now possible to use FWMariaDB to create and use MYSQL embedded server from version FWH 17.03, using libmysqld.dll instead of libmariadb.dll (or libmysql.dll). This Possible only with 32 bit Borland and MSVC Harbour / xHarbour. Not possible with 64 bit compliers.

Usage:

1) Download libmysqld.dll
2) Build implib libmysqld.lib for borland or msvc compiler as required.
3) Link the application with this implib instead of libmariadb.dll (or libmysql.lib)
4) Locate or create a folder containing "errmsg.sys" file for the language required. (cLangFolder)
5) Creae a folder for creation of the embedded server.(cDataFolder)
6) Use the same command for connection, specifying cDatFolder (with trailing backslash) as HOST and cLangFolder as LANGFOLDER. Important: cDataFolder should contain trailing backslash.

Syntax:

Code: Select all

FWCONNECT oCn HOST cDataFolder [LANGFOLDER cLangFolder] [DATABASE cDatabase]
//OR
oCn := maria_Embedded( cDataFolder, [cDataBase], [cLangFolder] )
 
Notes:
If cDataFolder contains "errmsg.sys" file, cLangFolder can be omitted.
All other functionality remains same as FWMARIADB server and rowsets

New READONLY DATAs:

Code: Select all

oCn:lEmbedded  // -> .T. for embedded and .F. otherwise
oCn:cDataFolder
oCn:cLangFolder
 


Unicode

To work with Unicode data, set FW_SetUnicode( .T. ) and then connect to the Server. To get best results, set FW_SetUnicode( .T. ) before creating the server for the first time.

Limitations:
https://dev.mysql.com/doc/refman/5.7/en ... tions.html

Sample:
\fwh\samples\mysqlmbd.prg
build*.bat needs to modified to include the implib ( libmysqld.lib )

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 9:39 am
by Baxajaun
Mr. Rao,

Great !!!

Best regards,

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 10:52 am
by Maurizio
Mr. Rao,

Grande !!!

can works with ADO ?

Maurizio
www.nipeservice.com

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 11:02 am
by nageswaragunupudi
ADO itself can not work with embedded MySql.
But ADO application can simultaneously work with FWMYSQL embedded MySql.

You can use ADO to connect to the remote server and use FWH to connect to a local embedded MySql on local Disk. Work with both the connections simultaneously.

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 12:13 pm
by nageswaragunupudi
Update:

In our tests it is possible to connect to both embedded server and also any number of main servers in the same application.
Requirements:
1) Link with libmysqld.lib instead of libmysql.lib
2) Connect to a local embedded server first before connecting to any remote server.

We welcome testing by users and feed back.

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 3:44 pm
by Horizon
Hi to all,

What is the difference with normal version and embedded server? Is it free?

Thank you,

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 4:29 pm
by TimStone
Available only with 32 bit Borland Harbour / xHarbour.
So it will NOT work with Harbour / MSVC++ ?????

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 4:45 pm
by nageswaragunupudi
Horizon wrote:Hi to all,

What is the difference with normal version and embedded server? Is it free?

Thank you,
Normally we need to first install MySql server. Either we install on our PC or a Server or use it.
In case of embedded version, we do not need to install any server.
Stores the data in a local folder. It is easy to distribute such a program to your clients.

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 4:47 pm
by nageswaragunupudi
TimStone wrote:
Available only with 32 bit Borland Harbour / xHarbour.
So it will NOT work with Harbour / MSVC++ ?????
We thought most users who are interested in MySql Emb server are Borland users.

Yes, it works on Harbour/MSVC32 also now. We do more tests before release.

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 5:02 pm
by TimStone
I'm not currently using SQL but keep considering using it. I currently have my primary application distributed in two formats:

1) The most used version is built with FWH / Harbour / MSVC++ ( Visual Studio 2015, and soon 2017 Community editions ). This option allows for features that do not work with other build options, ie. the camera capability.

2) I have a "compatible" version built with xHarbour mainly to support my clients who have 32 bit Advantage Database Server 7 or 8. When compared my customers say it is not as fast or smooth as the Microsoft build.

For me to transition to the MySQL embedded server, it would have to be available for MSVC++.

We have had the discussion here many times on this forum. My belief is that we will see more capabilities for FWH as Windows continues to evolve, and they will be most easily used when building with MSVC++. Since Community 2015 / 2017 is FREE, I'm often puzzled when people revert to older technologies.

So ... If a MSVC++ version becomes available, I will certainly want to work with it.

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 5:10 pm
by nageswaragunupudi
Yes, it will be available for embedded server also.
As it is FWH MSV32 connects to installed mysql servers already

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 5:22 pm
by TimStone
Can you give me any reference where I can learn about that ?

Also, is embedded server single user only, or can multiple users access it across a network ?

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 5:33 pm
by nageswaragunupudi
For multi-user usage, install MySql server on the network server or one of the computers. Users from all computers can use it.
FWH from 16.08 onwards works with MySql server on local network or remote or cloud. Works with all compilers Borland, xharbour, harbour, msvc 32 bits , msvc64 and borland 64
We suggest you use this option.

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 5:40 pm
by TimStone
OK ... but I have to learn how to use it. Is there any documentation ? Are the Maria samples showing how to use it in that way ? Are there links to training materials ?

I know there is nothing on the WIKI because I did check that.

Finally, I have seen many discussions about licensing. Can MySQL server Community ( Free ) edition be distributed to clients, or is there a licensing fee if we decided to use it with our application ? In the past, I saw fees posted, but I do not know the policy now. I see that Commercial starts at $ 2,000 and all my clients are businesses. Would they have to pay that fee for the MySQL software ?

Re: FWH 17.03 : MYSQL Embedded Server

Posted: Mon Mar 20, 2017 5:46 pm
by nageswaragunupudi
After you download 17.03, please try \fwh\samples\maria01.prg to maria08.prg with buildh32.bat. You do not need to do anything else except to build them with buildh32.bat. Then you also read the sources.
After that we are always here as well as other users to support you to migrate to MySql.