Unit Test Project and MySql Odbc Driver (Visual Studio Community 2013) - mysql

I created Unit Test Project in Visual Studio Community 2013.
I connect to MySql Database via MySQL ODBC 5.1 Driver.
When I run Unit Test Project as Console Application (exe), I connect to db succesufuly.
But when I run Unit Test from Visual Studio, error occured.
System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft] [ ... ODBC ] 'National language message'
I installed mysql-for-visualstudio-1.2.3.msi from Oracle, I connect to MySql from VisualStudio-ServerExplorer- DataConnection - MySql succesfully.
I try build Test Project as 32-bit,64-bit, but Test from Vs doesn`t work.

Self answering :-):
I have installed only 64-bit ODBC driver (see at c:\Program Files\MySQL\Connector ODBC 5.1). When I installed 32-bit ODBC driver (see at ODBC driver c:\Program Files (x86)\MySQL\Connector ODBC 5.1), UnitTestProject connect to MySql successfully.

Related

Error trying to connect Power BI Desktop with MariaDB running on Docker CentOS 7

I was trying to make the connection but Power BI shows this error:
"The 'Driver' property with value '{MariaDB ODBC 3.1 Driver}' doesn't correspond to an installed ODBC driver."
I've been following this site to configure the ODBC Driver :
https://mariadb.com/kb/en/about-mariadb-connector-odbc/
this one for the data source:
https://mariadb.com/kb/en/creating-a-data-source-with-mariadb-connectorodbc/
and this one to make the connection:
https://mariadb.com/resources/blog/getting-started-with-the-mariadb-direct-query-adapter-for-microsoft-power-bi/
I followed all the steps, even when i try :
$ isql MariaDB-server
The connection is succesfull
These are my:
odbc.ini
[MariaDB-server]
Description=MariaDB server
Driver=MariaDB ODBC 3.1 Driver
Trace=Yes
TraceFile=/tmp/trace.log
SERVER=xxx.x.x.x
USER=root
PASSWORD=xx
DATABASE=powerbiTest
PORT=3306
odbcinst.ini:
[MariaDB ODBC 3.1 Driver]
Description=MariaDB Connector/ODBC
Driver=/usr/lib64/libmaodbc.so
Setup=/usr/lib64/libodbcmyS.so
Driver64=/usr/lib64/libmaodbc.so
UsageCount=3
odbcinst -j
unixODBC 2.3.1
DRIVERS............: /etc/odbcinst.ini
SYSTEM DATA SOURCES: /etc/odbc.ini
FILE DATA SOURCES..: /etc/ODBCDataSources
USER DATA SOURCES..: /root/.odbc.ini
SQLULEN Size.......: 8
SQLLEN Size........: 8
SQLSETPOSIROW Size.: 8
What ive tried
1- Re-installing Power Bi
2- Creating another Docker Container
3- Installing ODBC Driver from source
4- Using MariaDB driver as Default modifying the .ini files
5- Changing parameters like servername, password ,etc
Id be grateful if anyone could help me!
Thanks!

ODBC Driver 17 unable to establish connection to MSSQL 2008 R2

I'm having an issue concerning my Debian 9 server on Apache2, php7.3, ODBC Driver 17, sqlsrv (7.3).
I can't connect it to my Microsoft SQL Server 2008 R2 running on a Windows Server 2003 R2.
I tried using
isql -v -k "DRIVER={ODBC Driver 17 For SQL Server};Server=SRV-WINDOS\MSSQLSERVER2008;UID=MyUser;PWD=MyPWD;Database=DB
on the Debian Server.
Outputs:
[08001][unixODBC][Microsoft][ODBC Driver 17 for SQL Server]TCP Provider: Error code 0x2746
[08001][unixODBC][Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
[ISQL]ERROR: Could not SQLConnect
The SQL server seems correctly set-up as I can connect to it with the same Symfony project on my local machine (Windows 10 running Wamp - apache2, php7.2.18, symfony4, doctrine and the sqlsrv extensions).
I also tried using the ODBC Driver 13 but I'm having issues with it,
[01000][unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql/lib64/libmsodbcsql-13.1.so.9.2' : file not found
since it seems like ODBC Driver 13 and lower are not supported on Debian 9`)
ODBC Driver 17 should enable me to establish a connection to my MSSQLSERVER 2008 R2 right ?
N.B: The Debian 9 server can indeed ping and resolves the domain of the MSSQLSERVER 2008 so it's not a networking issue.

microsoft odbc driver manager data source name not found and no default driver specified

I am trying to run a Classic ASP application on Windows 8.1. It keeps on failing with error: data source name not found and no default driver specified
I am using an Access database. I have the same problem using a MySQL database. I tried with both 32 bit and 64 bit MySQL drivers -- first installing one then uninstalling and then installing the other.
driver={MySQL ODBC 5.3 Driver};option=3;server=localhost;user=root;password=;DATABASE=test;
I'm using these MySQL ODBC drivers:
mysql connector 5.3.4 - win32
mysql connector odbc 5.3.2 - winx64
Access can't be accessed through the MySQL drivers (they're for MySQL not Ms Access), what you need is the Microsoft OLEDB database connections.
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\myFolder\myAccessFile.accdb;
Jet OLEDB:Database Password=MyDbPassword;
Source; https://www.connectionstrings.com/access/
Also for MySQL, if you're running a 32bit MySQL server on a 64bit machine the standard ODBC management tool won't work since it's the 64bit version by default.
You'd need to install in on the 32bit ODBC manager here c:\Windows\SysWOW64\odbcad32.exe
Once that's done you'd need the following connection string to work with a 32bit DB on a 64bit machine. Provider=MSDASQL;Driver={MySQL ODBC 5.2 ANSI Driver};Server=localhost;
Database=myDataBase;User=myUsername;Password=myPassword;Option=3;
Source; https://www.connectionstrings.com/mysql-connector-odbc-5-2/

Getting DSN architecture mismatch between Excel and ODBC MySql Connector

I'm getting the following error using Excel trying to add an external data source to the spreadsheet.
[Microsoft][ODBC Driver Manager]The specified DSN contains an architecture mismatch between the Driver and Application.
I can't find a compatibility chart between MySql and the MySql-ODBC Connector versions, but I got the latest that I could find. This is what I'm using:
mysql: 5.6.16 winx64
ConnectorODBC: 5.3.2x64
I've tried both the Ansi and Unicode versions of the driver. When adding it using the Windows Administrative Tools->Data Sources (ODBC) link the Test button says it connected successfully.
Data Source Name: Loans
TCP/IP server: localhost
Port: 3306
User:
Password:
Database: Loans
Thanks,
Ben
Your problem is that your client, Excel, is 32bit and needs to connect to a 32bit ODBC driver. Your 32bit ODBC driver will connect to a 64bit app just fine, what's important is that the client connects to a driver with the same architecture. On %windir%\syswow64 you'll find a file called odbcad32.exe, it's your 32bit ODBC control panel, add your 32bit MySQL ODBC driver there and use that to connect.

visual studio 2010 odbc driver mysql, failed to call ODBC driver connection utility

n win7 64bits, I have Visual Studio 2010 SP1
MySql connector net 6.5.6
MySql connector odbc 5.2.5 winx64
On Localhost I have the MySql database and can connect with MySqlWorkbench.
I have made a user-DSN and a system-DSN on the MySQL database.
In VS2010 I try to make a server Explorer- Data Connection with Micorsoft ODBC Data Source (ODBC) and select the system-data-source name and click OK.
Then I get the message 'Failed to call the ODBC driver connection utility'.
I have tried connector net 6.7.4, but than on a click the window 'add connection' disappears. Connector odbc 5.1.12 does not fix the problem.
In VS2005 on winXP with MySQL odbc 3.51 I can make a connection.
Is there something I miss for VS2010 ?
Deperate looking for a solution, after 2 days of trying :-(
Regards