FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Fwh used for Prestashop shopcard (SOLVED)
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Fwh used for Prestashop shopcard (SOLVED)
Posted: Wed Dec 14, 2016 11:54 AM

Hey,

Does anyone used FWH for connecting to the popular shopcard Prestashop ?

I'm looking into connecting to it so I could stop using the import functions of Prestashop.
and change stuff directly.

I can read/open the files with phpMyAdmin, so it can be opend for sure with FWH and SQL

I didn't read into the differences yet like : SQL or ADO or Dolphin .... used be several in this forum.

The fact is that I will use Xbrowse as master data manipulation.

Any starting tips for with i should use ?

My level of programming is rather low :wink: , so I could go for SQL since I use this also in some php programs.

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fwh used for Prestashop shopcard
Posted: Wed Dec 14, 2016 05:59 PM

Marc,

FWH already provide a built-in MySQL/MariaDB capabilities. You don't need any extra library.

Please review the docs:

viewtopic.php?f=3t=33286start=0

&&

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Fwh used for Prestashop shopcard
Posted: Wed Dec 14, 2016 10:10 PM
Antonio,

I read some posts, and some speek of linking extra lib's (mayby fwh libs ?)

Also installing : mysql-connector-odbc-5.3.7-win32.msi came as a solution. (did install it)

Should I include something extra ?

Now I have these. I even think that i don't need all these includes...

#include "FiveWin.ch"
#include "report.ch"
#include "hbcompat.ch"
#include 'ord.ch'
#include "XBrowse.Ch"
#include "fileio.ch"


this code give a error. Should I activate some ODBC or so ?

Code (fw): Select all Collapse
function Presta()

   local oCn, oRs

   local cServer     := "http://www.kaboutersopglabbeek.be/"
   local cDataBase   := "mydatabasename"
   local cUser       := "myusername"
   local cPassWord   := "mypaswoord"


   ? "Start"
   oCn   := FW_OpenAdoConnection( { "MYSQL", cServer, cDataBase, cUser, cPassword }, .t. )
   if oCn == nil
      ? "Connection Fail"
      return nil
   else
      ? "Connected"
   endif

   oRs   := FW_OpenRecordSet( oCn, "ploegen2006" )
   XBROWSER oRs
   oRs:Close()
   oCn:Close()

return nil


Marc Venken

Using: FWH 23.08 with Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fwh used for Prestashop shopcard
Posted: Thu Dec 15, 2016 08:38 AM

Marc,

Just using

include "FiveWin.ch"

compiles fine here.

I get the same error as you. We are reviewing it

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Fwh used for Prestashop shopcard
Posted: Thu Dec 15, 2016 09:43 AM
For MySql ADO to work, you need to download MySql ODBC connector from MySql site and install the msi file. Mr Marc Venken says he did it, but it appears not. He may please reinstall by way of caution.

Only #include "fivewin.ch" is enough.

Also please make sure that the server name, etc are correct.

If you have latest FWH versions, you do not need to do any of these things.

Just use FWH directly, without installing anything.
You may run this in fwh\samples\ folder
Code (fw): Select all Collapse
FWCONNECT oCn HOST cServer USER cUser PASSWORD cPassword DATABASE cDatabase
if oCn == nil
   ? "Failed to connect"
   return nil
else
   ? "Connected"
endif

oRs := oCn:RowSet( "ploegen2006" )
XBROWSER oRs


Important:
Please also let us know the FWH version you are using and ODBC connector version you download and install
Regards



G. N. Rao.

Hyderabad, India
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Fwh used for Prestashop shopcard
Posted: Thu Dec 15, 2016 12:13 PM

This version i have installed (instal with no errors, but I don't see if something changed)

mysql-connector-odbc-5.3.7-win32.msi

It was a link from your post somewhere on the forum.

The FWH version is : 16.11

Antonio has the same error on his system?

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Fwh used for Prestashop shopcard
Posted: Thu Dec 15, 2016 12:42 PM
Antonio has the same error on his system?

That was because he did not install the connector.

If you are using 16.11, my sample should work, if the credentials (server name, etc ) are correct. You did not indicate the port number. Please make sure about port number also.

Please build and run the sample I provided in fwh\samples folder or copy \fwh\dll\libmysql.dll to your exe folder.
Regards



G. N. Rao.

Hyderabad, India
Posts: 1487
Joined: Tue Jun 14, 2016 07:51 AM
Re: Fwh used for Prestashop shopcard (SOLVED)
Posted: Fri Dec 16, 2016 09:18 AM

Running the sample in de samples folder of FWH .AND. using the buildh.bat file did it working.

Version 16.11 does not need the : mysql-connector-odbc-5.3.7-win32.msi to be installed as far as i see.

It seems that my build file and Mak file is not good, not linking all needed stuff? Have to look into it :oops:

Marc Venken

Using: FWH 23.08 with Harbour
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Fwh used for Prestashop shopcard (SOLVED)
Posted: Fri Dec 16, 2016 09:29 AM

Marc,

There are many makefiles examples in these forums

Search here for makefile

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: Fwh used for Prestashop shopcard (SOLVED)
Posted: Fri Dec 16, 2016 11:52 AM

this feature I need also
a question I can use th esql archive of Prestashop directly on fw application or we must to converte on dbf and the reconverte into sql databse ?
I wish create a application because customer ask me th epossibility to change on local the clients,products,and print the order make on prestashop
I ask the gurus to make a teacher guide to use fwh and preestashop .Thanks

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion