FW_OpenAdoConnection() question

FW_OpenAdoConnection() question

Postby Marc Vanzegbroeck » Tue Jul 05, 2016 6:36 pm

Hi,

Normally I use something like, and is working fine:
Code: Select all  Expand view
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: Select all  Expand view
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
Image

I use FWH64-16.04 (build 3)
Last edited by Marc Vanzegbroeck on Tue Jul 05, 2016 8:11 pm, edited 1 time in total.
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: FW_OpenAdoConnection() question

Postby Marc Vanzegbroeck » Tue Jul 05, 2016 8: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: Select all  Expand view
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 :D :D :D :D :D
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: FW_OpenAdoConnection() question

Postby nageswaragunupudi » Wed Jul 06, 2016 1: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
User avatar
nageswaragunupudi
 
Posts: 10632
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 96 guests