MYOB ODBC Driver Architecture Mismatch

Do you like this?

This post shows you how to fix the ODBC connection error The specified DSN contains an architecture mismatch between the Driver and Application, especially for the MYOB ODBC Driver


MYOB is an accounting software which uses ODBC driver to allow third party applications to connect to its underlying database. However, it supports only the 32 bit connection whereas most operating systems now are running on the 64 bit. This experiment was carried out on a windows 7 64 bit in which java 7 (64 bit) was installed. I used JDBC to connect to ODBC in the following Java example.

import java.sql.*;

public class test {
	public static void main(String[] args) {
		 String jdbcURL = "jdbc:odbc:DSN=MYOB;TYPE=MYOB;Driver={MYOAU1001};"
		 + "UID=Administrator;PWD=;" + "ACCESS_TYPE=READ;"

		Connection conn = null;
		Statement stmt = null;
		ResultSet rs = null;

		try {

			conn = DriverManager.getConnection(jdbcURL);

			stmt = conn.createStatement();

		} catch (Exception e) {
When you first run this sample, you will face with the following error:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
	at sun.jdbc.odbc.JdbcOdbc.createSQLException(
	at sun.jdbc.odbc.JdbcOdbc.standardError(
	at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(
	at sun.jdbc.odbc.JdbcOdbcConnection.initialize(
	at sun.jdbc.odbc.JdbcOdbcDriver.connect(
	at java.sql.DriverManager.getConnection(
	at java.sql.DriverManager.getConnection(
The reason you are getting the error is because you are using C:\Program Files\Java\jdk1.7.0_25\jre\bin\javaw.exe which is in the 64 bit mode. If you install the 32 bit version of Java which will be located at C:\Program Files (x86)\Java\jdk1.7.0_21\bin\javaw.exe, it will not give you the error. It sounds complicated but you can use Eclipse IDE which allows you to choose which version of Java you want to use to run your applications. In Eclipse, the option is located at Preferences\Windows\Installed JREs.

comments powered by Disqus