0

We're trying to use pyodbc to connect to an ODBC connection that's correctly configured through Win10's OBDBC Data Source Administrator (32-bit), but the driver is "SPAN Open ODBC", a string we ironically can't find anywhere on the internet.

pyodbc throws "pyodbc.InterfaceError: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0) (Sified (0) (SQLDriverConnect)')", and when we check [print(x) for x in pyodbc.drivers()], "SPAN Open ODBC" is indeed absent.

We've found the DLL the Win ODBC Administrator uses at C:\Windows\SysWOW64\dhodbc.dll, but don't know how / if we should pass this to pyodbc. The company Win10 ODBC Administrator lists for it is "Dharma Systems", and the only docs we can find are from 1999...

I know this isn't much to work with but we're grasping at straws here. Do we have any options?

  • 1
    By "correctly configured" do you mean that you have a working 32-bit DSN which uses that driver? If you do `cnxn = pyodbc.connect("DSN=the_dsn_name;…") from 32-bit Python can you connect? If so, then you can use [dump_dsn](https://github.com/gordthompson/dump_dsn) to retrieve the DSN settings. – Gord Thompson Jul 29 '22 at 12:54
  • Yes, `dump_dsn` gave DSN strings nicely, thank you! Digressing from qn but we finally got error msg to change with connection str of keys in order: `DSN,DRIVER,SERVER,DATABASE,UID,PWD`. Error msg now: "specified DSN contains an architecture mismatch between the Driver and Application". Using 64 bit Python, driver is saved in "C:\WINDOWS\SysWOW64\", yet Win10's ODBC Administrator lists 32-bit under platform. We can't install 32 Bit Python on this PC. Ideas? – for_all_intensive_purposes Aug 01 '22 at 06:40
  • 1
    The name Windows\SysWOW64 is rather misleading: It is the folder where the 32-bit Windows subsystem (called "SysWOW64") stores its Windows\System32 files. So 64-bit stuff lives in Windows\System32, while 32-bit stuff lives in Windows\SysWOW64. Ah, "The things we do for backwards compatibility." In any case, the driver is 32-bit and 64-bit Python cannot use 32-bit drivers, period. Sorry. – Gord Thompson Aug 01 '22 at 12:47

0 Answers0