Link to home
Start Free TrialLog in
Avatar of Murray Brown
Murray BrownFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Javascript reference in ExcelWebAddIn Project

Hi

To use the following code in my JavaScript what reference would I have to make
"Microsoft ActiveX Data Objects 6.0 Library" and it didn't work

          connection = new ActiveXObject("ADODB.Connection");

            var ConnString = "Provider=SQLOLEDB;Data source=xxx;Initial catalog=Demo1;User Id=xxx;";
            connection.open(ConnString);
            var rs = new ActiveXObject("ADODB.Recordset");
            rs.Open("SELECT [Company] FROM [Contacts]", connection);
            rs.MoveFirst();
            while (!rs.eof) {
                document.write(rs.fields(1));
                rs.MoveNext();
            }
            rs.close();
            connection.close();

Open in new window

I get this serror
User generated image
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Murray Brown

ASKER

Thanks