Creating OdbcConnection to relativity client

2

I went through the process of creating the server and client ODBC objects in my computer to a Cobol database and I named the client PARSECCLI.

I tested the connection and it works. I can get datasets through Microsoft Query (I can't get Sql Server Management Studio to connect to it as a Linked Server or anything, but that's a separate question).

I can also create, through Visual Studio's wizard, a Datasource connection to it and the connection test succeeds. It creates this connection string:

Dsn=PARSECCLI;uid=.;codepage=1252

However, if I try to create an OdbcConnection to that string and open it - my end goal is to be able to run queries on the database and pull datasets from it - I get this:

System.Data.Odbc.OdbcException (0x80131937): ERROR [IM014] [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application

if I take advice from This question and change my connection string to this:

OdbcConnection dbConnection = new OdbcConnection("DRIVER={Relativity Client};ServerName=192.168.0.109.1583;DSN=PARSECCLI;UID=.;codepage=1252"); //The local IP I set to static when I created the client and server odbc Data Sources.

I get:

System.Data.Odbc.OdbcException (0x80131937): ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Should I be using a different sort of Connection type or am I missing something from my connection string/s?

c#
odbc
asked on Stack Overflow Oct 2, 2014 by ConnorU • edited May 23, 2017 by Community

1 Answer

2

The ODBC Administrator (odbcad32.exe) program comes in two versions on 64bit systems. The default one (the one present in the Administrative Tools) is the 64bit version and creates DSN names usable by 64bit programs (or AnyCPU programs that runs on 64 bit OS).

If you want your DSN usable by a 32 bit program create it with the ODBC Administrator available in the c:\windows\SysWOW64 folder.

Of course your application should use the appropriate Target CPU through BUILD -> Configuration Manager, Active Solution Platform.

Sadly I have no answer for the second issue but I hope that the first one is enough to allow you continue on your program

answered on Stack Overflow Oct 2, 2014 by Steve

User contributions licensed under CC BY-SA 3.0