• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1208
  • Last Modified:

Programmically connect to 32bit ODBC DSN from 64bit Windows

I need to use a 32bit ODBC DSN connection from Window 2008 64bit.   I have created a DSN using  C:\Windows\SysWOW64\odbcad32.exe     I do not have a 64bit driver for our progress database until 6-8 months from now. (fyi if I get it now it cost us $2500, if I wait until we upgrade our ERP system then its free)

In my code I have it just like the way I connecto to DSN on a 32bit server.

 public static string strODBCConn = "DSN=Nxt;UID=SYSPROGRESS;PWD=XXX;";

    public DataSet FillDataSetODBC(string strSQLCmd, string strTable, String strODBCConn)
        // return a filled dataset.
        DataSet myDS = new DataSet();
        OdbcDataAdapter DBAdapt = new OdbcDataAdapter();

        //Set up the data adapter...
        DBAdapt = new OdbcDataAdapter(strSQLCmd, strODBCConn);
        //Fill the dataset
        DBAdapt.Fill(myDS, strTable);
        return myDS;


  • 2
1 Solution
Basically, if your driver does not work on 64 bit windows, then you won't be able to do it through code either.

To find out whether your driver works and can connect to the datasource, can you add a connection in the Servers windows in VS? Or can you go to Control Panel > Administrative Tools > Data Sources to create a connection (after which you can take the connection string and copy it to your application, which should "just work").
edwardqAuthor Commented:
I discovered what I need to so..  I have to complie my program to target CPU x86.   Project Properties -> Complie -> Advanced Complie Options -> Change Target CPU from Any (default) to x86.
Sounds feasible. So the driver you were using was working on the x64 system. Good :-)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now