none
Connect to an Access database from VC express on a 64 bit machine running Vista. RRS feed

  • Question

  • This must be easy but I have spent all day ogling google.

    How do I make a connection to an Access 2007 database? I do not care if it is ADO, ODBC, OLE or some other native method. There does not appear to be a x64 bit version of the Jet 4.0 engine, and the express version of VC# does not support running in 32 bit mode. (The preceeding 'facts' are my opinion)

    Using the c:\windows\SysWOW64\odbcad32.exe I can create the ODBC dsn, but running in 64 bit mode my application does not 'see' it. At run time I get:

    Error: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    Using c:\windows\system32\odbcad32.exe there are no drivers to create the dsn.

    I have installed mdac 2.8 SP1 and the Access runtime engine. I also installed VC# 2008 and it works the same. This has to be trivial and I am being stupid.


    Wednesday, November 28, 2007 1:17 AM

Answers

  • You cannot run in 64bits mode because Access is a 32bits application which means you application is a mixed application so try AnyCPU instead of 64bits.  The reason you can only get Access in WOW64 and Vista does not come with MDAC so your options are limited.

     

    Wednesday, December 5, 2007 10:53 PM
  • There is no 64-bit version of the ACE OLEDB provider so it isn't possible to connect directly from a 64-bit app at this time. About the only alternative I can think of would be to create a 32-bit web service, which returns data from the Access database, and call that from the 64-bit app. Of course that will require that your system is configured to run 32-bit web apps as well.

     

    Thursday, December 6, 2007 1:31 PM

All replies

  • You cannot run in 64bits mode because Access is a 32bits application which means you application is a mixed application so try AnyCPU instead of 64bits.  The reason you can only get Access in WOW64 and Vista does not come with MDAC so your options are limited.

     

    Wednesday, December 5, 2007 10:53 PM
  • There is no 64-bit version of the ACE OLEDB provider so it isn't possible to connect directly from a 64-bit app at this time. About the only alternative I can think of would be to create a 32-bit web service, which returns data from the Access database, and call that from the 64-bit app. Of course that will require that your system is configured to run 32-bit web apps as well.

     

    Thursday, December 6, 2007 1:31 PM
  • Thank you, Gentlemen.

     

    One thing I should re-emphaises is that the express versions cannot target AnyCpu when running on a 64 bit machine. However I have now bought VS 2005 proper which can.

     

    Since MS has put its muscle firmly behind both 64 bit Vista and Access, it seems odd that they do not have a 64 bit provider. It is not as though they have to release a complete 64 bit Jet engine, just the interfaces would be enough.

     

    Thanks again.

     

    Thursday, December 6, 2007 1:39 PM