Chad Harrison
Chad Harrison

Reputation: 2858

Why doesn't JavaScript recognize the Microsoft.ACE.OLEDB.16.0 driver?

The reference machine is a Windows 7 Professional x64 with Office 2013 installed running Internet Explorer 10. I check the ODBC Data Source and see I have all my ODBC drivers installed like so:

ODBC Data Source Admin

Then I go to setup my connection string using the UDL setup dialog, and I also see the drivers that I want:

enter image description here

I proceed to test my connection properties, and get a success:

enter image description here

However, when I try to run the following snippet of JavaScript in IE10's debugger, it returns SCRIPT3706: Provider cannot be found. It may not be properly installed.

<script language='JavaScript' > 
    var strConn = 'Provider=Microsoft.ACE.OLEDB.16.0;Data Source=userdb.accdb;Persist Security Info=False;'; 
    var sqlMaxId = 'SELECT Max(idnum) AS MaxID FROM users';

    function getMaxId() 
    { 

        var cn = new ActiveXObject('ADODB.Connection'); 
        var rs = new ActiveXObject('ADODB.Recordset');  

        cn.Open(strConn); 
        rs.Open(sqlMaxId, cn); 

        window.alert(rs(0));

        rs.Close(); 
        cn.Close(); 

    } 


 </script> 

enter image description here

What am I missing? Is ADODB dead in a 64-bit world? Is there a suitable replacement?

Upvotes: 0

Views: 718

Answers (0)

Related Questions