FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour FW_OpenAdoConnection() question
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
FW_OpenAdoConnection() question
Posted: Tue Jul 05, 2016 06:36 PM
Hi,

Normally I use something like, and is working fine:
Code (fw): Select all Collapse
oSQL:=CreateObject("ADODB.Connection")
oSQL:ConnectionString:="Driver={MySQL ODBC 5.1 Driver};Server=localhost;Port=3306;Database=MyDatabase;User=root;Password=MyPassword;Option=3;"
oSQL:Open()

to open my MariaDB-database.

Now I wanted to try this with FW_OpenAdoConnection(), but get an error opening the database:
I try with
Code (fw): Select all Collapse
local oCn
local cServer     := "localhost"
local cDataBase   := "MyDatabase"
local cUser       := "root"
local cPassWord   := "MyPassword"
   oCn   := FW_OpenAdoConnection( { "MYSQL", cServer, cDataBase, cUser, cPassword }, .t. )
   if oCn == nil
      ? "Connection Fail"
      return nil
   else
      ? "Connected"
   endif


The error is


I use FWH64-16.04 (build 3)
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: FW_OpenAdoConnection() question
Posted: Tue Jul 05, 2016 08:02 PM
I found the problem.

I use a connectionstring "{MySQL ODBC 5.2w Driver}".
This not included in the saProviders-array in addofuncs.prg

now I use
Code (fw): Select all Collapse
 oCn   := FW_OpenAdoConnection(  "Driver={MySQL ODBC 5.2w Driver};Server=localhost;Port=3306;Database=MyDatabase;User=root;Password=MyPassword;Option=3;", .t. )


And it's working :-) :-) :-) :-) :-)
Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: FW_OpenAdoConnection() question
Posted: Wed Jul 06, 2016 01:45 AM

Thanks for the information.
We shall now include 5.2w also.

Even otherwise, from 16.05 onwards, if FW_SetUnicode() is true, connection is made to Unicode driver and in that case connecting to 5.2w might succeed

Regards



G. N. Rao.

Hyderabad, India

Continue the discussion