THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | Join | Help
in Search

John Paul Cook

32-bit ODBC on Windows Server 2008 R2

Heterogeneous data access requires having the right drivers. If you have to use 32-bit ODBC drivers, you won’t find then when you start the Microsoft ODBC Administrator because it is 64-bit. The 32-bit ODBC Administrator is found here: C:\Windows\SysWOW64\odbcad32.exe

You might want to make a shortcut for it to make it easy to find. You’ll need to use it when make 32-bit ODBC data connections.

Published Tuesday, March 16, 2010 7:16 PM by John Paul Cook

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

 

Me said:

Thank you, John Paul Cook!  We've been trying to figure this out for hours!

March 24, 2010 3:49 PM
 

Andrew Wen said:

Where should I put the shortcut? I found ODBCAD32.exe in Windows\System32 too. Thanks.

AWen@Teledyne.com

June 8, 2010 3:01 PM
 

John Paul Cook said:

Put the shortcut wherever you want. It is for your convenience.

June 8, 2010 3:46 PM
 

Peter Moh said:

I used C:\Windows\SysWOW64\odbcad32.exe to call XLS connection with sun.jdbc.odbc.JdbcOdbcDriver successfully.

But recently, get error:[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application.

The registry file no changed.  

The test program is:

public class testXlsConnection{

   static String msgjdbcodbcString = "jdbc:odbc:msgsheet";

  static Connection likeXlsConnection = null;

public static void main(String[] args){

 try{

likeXlsConnection = getlikeXlsConnection();

if (likeXlsConnection == null){

  System.exit(0);

  }

try {

              likeXlsConnection.close();

            System.out.println("<<<<JDBC, ODBC Connection and files closed safely...>>>");

      } catch (Exception e) {

 System.out.println("Final error:>>>"+ e.getMessage() + "<<<\n");

      }

System.out.println("testXlsConnection Completed!!!");

      }

      catch(Exception ex){

  System.out.println("Exception in main " + ex.getMessage()+"***");

  }

}

public static Connection getlikeXlsConnection() throws ClassNotFoundException, SQLException {

   Connection likeXlsCon = null;

   try{//read data from main spreadsheet then insert records to corresponding tables

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

likeXlsCon = DriverManager.getConnection(msgjdbcodbcString);//"jdbc:odbc:msgsheet" );xlsCon;

System.out.println(msgjdbcodbcString + " Connection succesed...");

   }

   catch(ClassNotFoundException ce){

System.out.println("ClassNotFoundException for >>>" + msgjdbcodbcString + "<<<"+ ce.getMessage() );

}

catch(SQLException sqle){

System.out.println("SQLException Connection for >>>" + msgjdbcodbcString + "<<<"+ sqle.getMessage() );

}

   catch(Exception e){

System.out.println("Fail to establish Connection for >>>" + msgjdbcodbcString + "<<<"+ e.getMessage() );

}

   return likeXlsCon;

 }

}

/*from ControlPanel>>Administrator tool>>Data Source(ODBC)

Then right lick, properties box shown as:

Data Source (ODBC) properties:

Target Type: Application

Target Location: SysWOW64

Target: %windir%SysWoW64\odbcad32.exe

Start in: %windir%\SysWOW64

*/

August 16, 2011 10:24 AM
 

John Paul Cook said:

Code samples should be posted to MSDN forums instead of here.

August 16, 2011 7:16 PM
 

Frank Hall said:

Thanks for this info, John. I wonder why this is so hard to find at Microsoft! Much appreciated.

September 6, 2011 10:32 AM

Leave a Comment

(required) 
(optional)
(required) 
Submit

About John Paul Cook

SQL Server MVP based in Houston, Texas. Contributing author to SQL Server MVP Deep Dives and SQL Server MVP Deep Dives Volume 2. John is currently on sabbatical from database consulting and is very busy as a full-time nursing student.
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement