Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Hello,
I want to make a CRUD application (Create, Retrieve, Updata, Delete) with Fivewin 2015/Xharbour, ActiveX Data Objects (ado) and MySQL.
I make this post because of the recommendation of Antonio to make use of ado. See topic viewtopic.php?f=3&t=30066
In that post one can download https://bitbucket.org/fivetech/fivewin- ... 140730.zip. (First I tried to establish a connection with testsql1.prg).
My goal of this post is to get a good understanding of how diferent technologies work together (Fivewin, xharbour, ado, mysql etc.) and to make a little application (crudapp.prg).
The goal above is a subgoal of general goal: To find possible solutions based on SQL for an existing software program, which now uses .dbf technology and Advantage Database Server (Ads). (Later I will probably give more information and ask some advice about this general goal in a new topic).
First I give an overview of alle the technologies I use.
-Windows 8.1 (64 bit) on a virtual machine (virtualbox)
-Fivewin 2015
-xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
-Borland 5.5 compiler
-MySQL Server 5.6.22 (also with ODBC 5.3.4 connector for MySQL)
Directory structure is:
C:\Borland\BCC55 (borland compiler)
C:\fwh (fivewin 2015)
C:\xHarbour (Xharbour compiler)
C:\Dev\crudapp (In this directory I will make the application crudapp.prg)
C:\Dev\fivedbu (In this directory I wil try to get fivedbu.prg working, which comes from the fivewin 2015 libraries samples or from https://bitbucket.org/fivetech/fivewin- ... 140730.zip)
-I make use of .bat file located in C:\Dev which is a little adjustment of the original buildx.prg from the fivewin 2015 library (For eample: if "%FWDIR%" == "" set FWDIR=c:\fwh instead of if "%FWDIR%" == "" set FWDIR=.\..\ etc.)
Questions:
-Does it matter if I use fivedbu.prg from the samples in fivewin 2015 library or https://bitbucket.org/fivetech/fivewin- ... 140730.zip? (maybe some differences?)
-I get an error when I compile fivedbu.prg (copied file from c:\fwh\samples to c:\dev\fivedbu): Error fivedbu.RC 4 8: Cannot open file: WinXP/WindowsXp.Manifest *Linking errors* (how to solve this?)
-In fivedbu_20140730 directory I get the error (from .zip): fivedbu.prg(665) Error E0067 TRY section requires a CATCH or FINALLY handler
There is also something with a resource file (.rc), I do not understand exactly how that works.
Kind regards,
Pieter
I want to make a CRUD application (Create, Retrieve, Updata, Delete) with Fivewin 2015/Xharbour, ActiveX Data Objects (ado) and MySQL.
I make this post because of the recommendation of Antonio to make use of ado. See topic viewtopic.php?f=3&t=30066
In that post one can download https://bitbucket.org/fivetech/fivewin- ... 140730.zip. (First I tried to establish a connection with testsql1.prg).
My goal of this post is to get a good understanding of how diferent technologies work together (Fivewin, xharbour, ado, mysql etc.) and to make a little application (crudapp.prg).
The goal above is a subgoal of general goal: To find possible solutions based on SQL for an existing software program, which now uses .dbf technology and Advantage Database Server (Ads). (Later I will probably give more information and ask some advice about this general goal in a new topic).
First I give an overview of alle the technologies I use.
-Windows 8.1 (64 bit) on a virtual machine (virtualbox)
-Fivewin 2015
-xHarbour 1.2.3 Intl. (SimpLex) (Build 20141106)
-Borland 5.5 compiler
-MySQL Server 5.6.22 (also with ODBC 5.3.4 connector for MySQL)
Directory structure is:
C:\Borland\BCC55 (borland compiler)
C:\fwh (fivewin 2015)
C:\xHarbour (Xharbour compiler)
C:\Dev\crudapp (In this directory I will make the application crudapp.prg)
C:\Dev\fivedbu (In this directory I wil try to get fivedbu.prg working, which comes from the fivewin 2015 libraries samples or from https://bitbucket.org/fivetech/fivewin- ... 140730.zip)
-I make use of .bat file located in C:\Dev which is a little adjustment of the original buildx.prg from the fivewin 2015 library (For eample: if "%FWDIR%" == "" set FWDIR=c:\fwh instead of if "%FWDIR%" == "" set FWDIR=.\..\ etc.)
Questions:
-Does it matter if I use fivedbu.prg from the samples in fivewin 2015 library or https://bitbucket.org/fivetech/fivewin- ... 140730.zip? (maybe some differences?)
-I get an error when I compile fivedbu.prg (copied file from c:\fwh\samples to c:\dev\fivedbu): Error fivedbu.RC 4 8: Cannot open file: WinXP/WindowsXp.Manifest *Linking errors* (how to solve this?)
-In fivedbu_20140730 directory I get the error (from .zip): fivedbu.prg(665) Error E0067 TRY section requires a CATCH or FINALLY handler
There is also something with a resource file (.rc), I do not understand exactly how that works.
Kind regards,
Pieter
- Rick Lipkin
- Posts: 2677
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
- Been thanked: 2 times
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Pieter
You have to understand two things about Sql programming ..
1) How am I going to connect to the Sql Database ?
Each Sql RDMS has its own 'connector' to its Database .. MySql connects via ODBC, MsAccess, MsSql Server,Oracle,dB2 use an OleDb client. There are advantages and disadvantages in making the best choice for you. MySql requires you to configure the ODBC connection on EVERY computer that wishes to use your application. Oracle and dB2 have their own client you have to install on every machine however, you do not have to configure anyrhing on the desktop. MsAccess and Ms Sql Server use the BUILT IN OleDb client that Microsoft supplies with Windows including WinXp through Win 8.1 and probably 10... and that is a BIG PLUS. Just write your program and include the proper connection string and programatically you can connect to your database.
2) ADO is a set of Microsoft classes that allow you to manipulate your data through a set of unified methods under the Ado class. Thant means you can create your code, recordsets and with just the change of the connection string, talk to any RDMS database without very little if any coding changes.
Here are several links to get you started understanding ADO :
http://wiki.fivetechsoft.com/doku.php?i ... ted_stuffs
Here is a second link that uses wrappers to simplify the Ado code into single functions :
http://wiki.fivetechsoft.com/doku.php?id=ado_support
Hope this helps answer your questions.
Rick Lipkin
You have to understand two things about Sql programming ..
1) How am I going to connect to the Sql Database ?
Each Sql RDMS has its own 'connector' to its Database .. MySql connects via ODBC, MsAccess, MsSql Server,Oracle,dB2 use an OleDb client. There are advantages and disadvantages in making the best choice for you. MySql requires you to configure the ODBC connection on EVERY computer that wishes to use your application. Oracle and dB2 have their own client you have to install on every machine however, you do not have to configure anyrhing on the desktop. MsAccess and Ms Sql Server use the BUILT IN OleDb client that Microsoft supplies with Windows including WinXp through Win 8.1 and probably 10... and that is a BIG PLUS. Just write your program and include the proper connection string and programatically you can connect to your database.
2) ADO is a set of Microsoft classes that allow you to manipulate your data through a set of unified methods under the Ado class. Thant means you can create your code, recordsets and with just the change of the connection string, talk to any RDMS database without very little if any coding changes.
Here are several links to get you started understanding ADO :
http://wiki.fivetechsoft.com/doku.php?i ... ted_stuffs
Here is a second link that uses wrappers to simplify the Ado code into single functions :
http://wiki.fivetechsoft.com/doku.php?id=ado_support
Hope this helps answer your questions.
Rick Lipkin
- Antonio Linares
- Site Admin
- Posts: 42660
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 69 times
- Been thanked: 96 times
- Contact:
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Pieter,
FWH\samples\FiveDBU.prg is always the most recent version.
If you copied fivedbu.prg from c:\fwh\samples to c:\dev\fivedbu please also copy the folder (and its files) c:\fwh\samples\WinXP to c:\dev\fivedbu\WinXP
Please use c:\FWH\samples\fivedbu.prg source code.
.RC is a Windows resources files. buildx.bat automatically will compile the RC into a RES file and will embed it into the EXE.
-Does it matter if I use fivedbu.prg from the samples in fivewin 2015 library or https://bitbucket.org/fivetech/fivewin- ... 140730.zip? (maybe some differences?)
FWH\samples\FiveDBU.prg is always the most recent version.
-I get an error when I compile fivedbu.prg (copied file from c:\fwh\samples to c:\dev\fivedbu): Error fivedbu.RC 4 8: Cannot open file: WinXP/WindowsXp.Manifest *Linking errors* (how to solve this?)
If you copied fivedbu.prg from c:\fwh\samples to c:\dev\fivedbu please also copy the folder (and its files) c:\fwh\samples\WinXP to c:\dev\fivedbu\WinXP
-In fivedbu_20140730 directory I get the error (from .zip): fivedbu.prg(665) Error E0067 TRY section requires a CATCH or FINALLY handler
Please use c:\FWH\samples\fivedbu.prg source code.
There is also something with a resource file (.rc), I do not understand exactly how that works.
.RC is a Windows resources files. buildx.bat automatically will compile the RC into a RES file and will embed it into the EXE.
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Rick,
Thanks for the information:D, I think it is very important that I understand these concepts, while I am programming. I am going to try to get some programs working (fivedbu.prg and your code from http://wiki.fivetechsoft.com/doku.php?i ... ted_stuffs).
Pieter
Thanks for the information:D, I think it is very important that I understand these concepts, while I am programming. I am going to try to get some programs working (fivedbu.prg and your code from http://wiki.fivetechsoft.com/doku.php?i ... ted_stuffs).
Pieter
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Antonio,
Thanks!, I copied the directory WinXP from c:\fwh\samples to c:\dev\fivedbu, the error in fivedbu.prg is gone, but I got a new one.
Fatal: Acces violation. Link terminated. *Linking Errors*
(I got the same error when I compiled fivedbu.prg c:\fwh\samples)
Thanks!, I copied the directory WinXP from c:\fwh\samples to c:\dev\fivedbu, the error in fivedbu.prg is gone, but I got a new one.
Fatal: Acces violation. Link terminated. *Linking Errors*
(I got the same error when I compiled fivedbu.prg c:\fwh\samples)
- Antonio Linares
- Site Admin
- Posts: 42660
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 69 times
- Been thanked: 96 times
- Contact:
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Pieter,
You are using Borland 5.5 and you should be using version 5.82
You are using Borland 5.5 and you should be using version 5.82
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Antonio,
Yes
, using Borland 5.82 is indeed the solution, fivedbu.prg is now working.
Yes

- Antonio Linares
- Site Admin
- Posts: 42660
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 69 times
- Been thanked: 96 times
- Contact:
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Hi,
I am now trying to establish a connection from the program fivedbu with my Mysql Server. I understood from Rick Lipkin, that for Mysql I need a ODBC connection.
I have installed MySQL Server 5.6.22 with Connector/ODBC 5.3.
In Fivedbu I do the following steps:
1: ADO open
2: I choose Microsoft OLE DB Provider for ODBC drivers
3: I click next
4: Use datasource name or use connection string?
5: I push build in connection string, what kind of file do I have to search for or what kind of string can I put in.
(I found on this forum the following string: Driver={MySQL ODBC 5.3 Unicode Driver};Server=YourServersIP;Port=3306;Database=YourDatabseName;User=YourUserName;Password=YourPassword;Option=3;)
Kind regards,
Pieter
I am now trying to establish a connection from the program fivedbu with my Mysql Server. I understood from Rick Lipkin, that for Mysql I need a ODBC connection.
I have installed MySQL Server 5.6.22 with Connector/ODBC 5.3.
In Fivedbu I do the following steps:
1: ADO open
2: I choose Microsoft OLE DB Provider for ODBC drivers
3: I click next
4: Use datasource name or use connection string?
5: I push build in connection string, what kind of file do I have to search for or what kind of string can I put in.
(I found on this forum the following string: Driver={MySQL ODBC 5.3 Unicode Driver};Server=YourServersIP;Port=3306;Database=YourDatabseName;User=YourUserName;Password=YourPassword;Option=3;)
Kind regards,
Pieter
- Daniel Garcia-Gil
- Posts: 2365
- Joined: Wed Nov 02, 2005 11:46 pm
- Location: Isla de Margarita
- Contact:
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Hello
you can use data source name or connection string
data source name
look at: http://windows.microsoft.com/en-us/windows/using-odbc-data-source-administrator#1TC=windows-7
How do I open the ODBC Data Source Administrator?
What is the User DSN tab for?
after created the DSN you can use it in fivedbu
connection string
you should use same driver name like in ODBC Data Source Administrator
in my case

the connection string is: Driver={MySQL ODBC 5.2a Driver};Server=localhost;Port=3306;User=<user>;Password=<pass>;Database=<database>;Option=3;
if you prefer not use user and password inside the string, delete from connection string and fill the input available in fivedbu
you can use data source name or connection string
data source name
look at: http://windows.microsoft.com/en-us/windows/using-odbc-data-source-administrator#1TC=windows-7
How do I open the ODBC Data Source Administrator?
What is the User DSN tab for?
after created the DSN you can use it in fivedbu
connection string
you should use same driver name like in ODBC Data Source Administrator
in my case

the connection string is: Driver={MySQL ODBC 5.2a Driver};Server=localhost;Port=3306;User=<user>;Password=<pass>;Database=<database>;Option=3;
if you prefer not use user and password inside the string, delete from connection string and fill the input available in fivedbu
our best documentation is the source code
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Isla de Margarita Venezuela.
danielgarciagil@gmail.com
http://tdolphin.blogspot.com/
https://www.dropbox.com/referrals/NTI5N ... rc=global9
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Hi Daniel
Thanks for this information
. I managed to make Data Source Name (odbcmysql64unicodeconnector) in the ODBC manager, I have tested the connection (in odbc manager) and it succesfull. In fivedbu the name (odbcmysql64unicodeconnector) is recognized in step 1, when I did Test Connection, it fails. I also tried it with filling in the Username and Password Of Superuser root. It did not work either. I thought that the server in step 2 is the MySQL server.
I go further with finding a solution, maybe somebody knows what problem I have and have some tips.
Pieter
Thanks for this information

I go further with finding a solution, maybe somebody knows what problem I have and have some tips.
Pieter
- Antonio Linares
- Site Admin
- Posts: 42660
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Has thanked: 69 times
- Been thanked: 96 times
- Contact:
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Pieter,
Based on your connection name it seems as it is a 64 bits driver (I am just guessing), and if you are using a 32 bits app (if you are using FWH 32 bits) then that may be the reason for not working.
Anyhow, could you post a screenshot of your ODBC manager panel so we can see how it is configured ? thanks
Based on your connection name it seems as it is a 64 bits driver (I am just guessing), and if you are using a 32 bits app (if you are using FWH 32 bits) then that may be the reason for not working.
Anyhow, could you post a screenshot of your ODBC manager panel so we can see how it is configured ? thanks
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Hi Antonio,
Here are some screenshots (The first 4 pictures shows the ODBC 32 manager and the last one is from the ODBC 64 manager. I download and installed a MySQL 5.5 Community Server 32 bit, it does not appear in the list of the ODBC 32bit manager. I also think it possible that the problem is because of the 32 bit/64 bit differences. I understand the differences of 32 bit/64 bit in general, but I still don't understand how it works in this situation, with multiple technologies working together.




(64 bit)
Maybe somebody knows a solution
Best regards,
Pieter
Here are some screenshots (The first 4 pictures shows the ODBC 32 manager and the last one is from the ODBC 64 manager. I download and installed a MySQL 5.5 Community Server 32 bit, it does not appear in the list of the ODBC 32bit manager. I also think it possible that the problem is because of the 32 bit/64 bit differences. I understand the differences of 32 bit/64 bit in general, but I still don't understand how it works in this situation, with multiple technologies working together.





Maybe somebody knows a solution

Best regards,
Pieter
- carlos vargas
- Posts: 1723
- Joined: Tue Oct 11, 2005 5:01 pm
- Location: Nicaragua
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Salu2
Carlos Vargas
Desde Managua, Nicaragua (CA)
Carlos Vargas
Desde Managua, Nicaragua (CA)
Re: Fivewin/xharbour with ActiveX Data Objects (ado) and MySQL
Hi Carlos, thanks for this great solution! 
mysql-connector-odbc-5.3.4-win32.msi is the solution, (http://dev.mysql.com/downloads/connector/odbc/ is also a location where mysql-connector-odbc-5.3.4-win32.msi can be found)
My Connection with fivedbu and Mysql is now working!
Pieter

mysql-connector-odbc-5.3.4-win32.msi is the solution, (http://dev.mysql.com/downloads/connector/odbc/ is also a location where mysql-connector-odbc-5.3.4-win32.msi can be found)
My Connection with fivedbu and Mysql is now working!
Pieter