ADO Connection to MariaDB

  ado, c++, database, mariadb

I try to connect in a C++ via Ado to a MariaDB Database.

CADODatabase m_dbConnection;

(my test.h)

m_dbConnection.SetConnectionString(strConnectionString);
m_dbConnection.SetConnectionTimeout(60);

Connection String is

DRIVER={MariaDB ODBC 3.1 Driver}; Server=10.15.180.21; Port=3306; database=db; UID=8001; password=********;

I tried to setup a DSN but I donĀ“t know how the connection string has to look like?

DSN=Name; 

Is it important if the program is a 32 or 64 bit version? which DSN is used in this case?

I always get the error:

Init(): Could not connect to database with connection string 'DSN=Cue1 DATABASE=yesdb'
Error message: Connection String = DSN=Cue1 DATABASE=yesdb
CADODataBase Error
Code = 80004005
Code meaning = Unspecified error
Source = Microsoft OLE DB Provider for ODBC Drivers
Description = [Microsoft][ODBC Driver Manager] Data source name not found and no default driver 
specified

or

Init(): Could not connect to database with connection string 'Driver={MariaDB ODBC 3.1 Driver} 
Server=10.15.180.21; Port=3306; database=yesdb; UID=8001; password=!98Waples77!;Option=3;'
Error message: Connection String = Driver={MariaDB ODBC 3.1 Driver} Server=xx.xx.xx.xx; Port=3306; 
database=db; UID=8001; password=xxxxxx;Option=3;
CADODataBase Error
Code = 80040e73
Code meaning = IDispatch error #3187
Source = Microsoft OLE DB Service Components
Description = Format of the initialization string does not conform to the OLE DB specification.`

Any ideas?

Source: Windows Questions C++

LEAVE A COMMENT