Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am having difficulties using a DSN that was defined in the 32 Bit version of the ODBC-manager? (there are two separate managers for 32/64 Bit on a 64 Bit machine)

Using the DatabaseLink package will give an error as the DSN is not found and unfortunately I cannot find how to make it use the 32 Bit ODBC in the documentation.

share|improve this question
    
What error are you getting? –  Verbeia Apr 18 '12 at 10:29
1  
This may become messy. We had a related problem and only solved it by switching to a freshly setup 64bit machine. Can you delete the 32bit ODBC DSN and try with a new 64bit one? –  Yves Klett Apr 18 '12 at 10:58
    
In[160]:= conn = OpenSQLConnection[JDBC["odbc", "accessDatabase"]] (* where "accessDatabase" is a 32bit DSN *) During evaluation of In[160]:= JDBC::error: [Microsoft][ODBC Driver Manager] Der angegebene DSN weist eine nicht übereinstimmende Architektur von Treiber und Anwendung auf.>> (Translation: DSN does not have a compatible architecture with regard to the driver.) This is to reproduce the error; for further comments please refer to the Answer 1 where I have commented also. Thanks. –  gwr Apr 18 '12 at 14:31

1 Answer 1

up vote 7 down vote accepted

You might be facing the problem documented in Microsoft's knowledge base as KB942976. In a nutshell, the system call that enumerates DSNs on a 64-bit system will also list 32-bit DSNs -- even though those DSNs cannot be accessed from a 64-bit application. The knowledge base article states that there is no current resolution to this problem in the interest of backward compatibility (?).

It seems that you have only two choices:

  1. Run the 32-bit version of Mathematica to continue using the 32-bit DSN, or
  2. Create a new 64-bit DSN for use with 64-bit Mathematica.
share|improve this answer
    
Thank you (all) for helping. My own research has revealed something similar, so the 32 Bit DSN cannot be used by Mathematica 64 Bit. Unfortunately while Office 32 Bit is installed Windows will not let me install the Access ODBC Driver for 64 Bit ;-( Guess that means running on 32 Bit in Mathematica (how?). With DLL there is the option of Forcing 32 Bit with the Reinstall of the NETLink - would something similar work with the JLink? (After all it is Jlink that works underneath the Mathematica in DatabaseLink?) Is there some other 64 Bit ODBC Driver that connects to Access (.accdb)? –  gwr Apr 18 '12 at 14:26
1  
+1 for "in the interest of backward compatibility" :) –  belisarius Apr 18 '12 at 16:03
1  
It is not Mathematica that needs to run in 32-bit mode, but rather the Java runtime used by J/Link. To force the use of a 32-bit JVM, you can do as follows. You probably already have a 32-bit Java installed at the following location, and if not, you can install one from java.com. Needs["JLink`"]; ReinstallJava[CommandLine->"C:\\Program Files (x86)\\Java\\jre7\\bin\\javaw"]. This is the J/Link equivalent of the Force32Bit option that is in .NET/Link. –  Todd Gayley Jul 31 '13 at 15:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.