Link to home
Start Free TrialLog in
Avatar of Edward
EdwardFlag for United States of America

asked on

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;

    }

Avatar of abel
abel
Flag of Netherlands image

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").
ASKER CERTIFIED SOLUTION
Avatar of Edward
Edward
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sounds feasible. So the driver you were using was working on the x64 system. Good :-)