views:

774

answers:

1

Hello,

I'm developing a Vista gadget. The gadget is working with local .mdb database, OLEDB used. The code is following:

var cs = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + getDbFilePath() + ";Persist Security Info=False;";
var connection = new ActiveXObject("ADODB.Connection");
connection.ConnectionString = cs;

It works under Vista 32, but fails under x64 with message: Provider cannot be found. It may not be properly installed.

When I'm running the javascript file from command line, no errors occurs. getDbFilePath() return correct path, database exists etc.

How to fix it? Maybe, there a sense to use other database provider?

Thank you

A: 

There is no native Jet image registered/available for x64 - it is only available in 32bit processes on x64. The sidebar executable is being run as a native x64 image - hence it fails.

Your choices seem limited:

  1. Give up on Jet, e.g. switch to one of SQL Compact Edition, SQL Express or similar
  2. Wrap your Jet calls in a surrogate 32bit COM object. Register the object as out-of-process in the 64bit registry. e.g.

    http://dnjonline.com/article.aspx?ID=jun07_access3264

  3. No x64 support

Trying to force the sidebar to run in 32bit mode appears difficult/impossible let alone unreasonable.

stephbu
I'm using a legacy database, so switching database is not an option. So I will try create w wrapper.Thanks for help.