如何通过Apps for Office为SQL Azure创建连接字符串? [英] How do I create connection string for SQL Azure through the Apps for Office?

查看:96
本文介绍了如何通过Apps for Office为SQL Azure创建连接字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的Office应用程序与SQL Azure连接,或者如果不可能,我将使用SQL Server(本地)。目标是构建本地应用程序,其中的数据可以通过云控制,也可以通过不同的应用程序访问
和不同的地方。


我尝试使用ActiveX控件在SQL Azure中读取数据库(这与在SQL Server中读取数据库相同)。我还在Internet Explorer中启用了所有ActiveX配置(工具 - > Internet选项 - >安全 - >自定义
级别),但它返回了此错误:


0x80004005 - JavaScript运行时错误:[Microsoft] [ODBC驱动程序管理器]未找到数据源名称且未指定默认驱动程序


我在JavaScript中的代码:

 function readDB(){
var connection = new ActiveXObject(" ADODB.Connection");
var connString =" Server = vswughrcjn.database.windows.net; Database = theosqloffice; User ID = xxxxx; Password = xxxx; Trusted_Connection = False; Encrypt = True;" ;;
connection.Open(connString);
var rs = new ActiveXObject(" ADODB.Recordset");
rs.Open(" SELECT itemcode FROM itemlist",connString);
rs.MoveFirst
while(!rs.eof){
document.write(rs);
rs.movenext;
}

rs.close;
connString.close;
}

现在,我的问题是:


  1. 我的连接字符串是否为SQL Azure是对的吗?如果是,我可以使用ADODB连接将我的应用程序连接到使用JavaScript的SQL Server / Azure吗?

  2. 有没有办法连接SQL Azure / Server而不使用的ActiveX?使用ActiveX只会为用户创建启用它的困难时间。

谢谢:)




解决方案


感谢您在MSDN上发帖论坛。


我会就你的问题咨询我的同事。如果有任何更新,我们会通知您。


感谢您的耐心和理解。


祝你好运,


I want to connect my app for Office with SQL Azure or if it's not possible, I will use SQL Server (local) instead. The aim is to build on-premises apps that the data inside them can be controlled via the cloud and also can be accessed via different apps and also different places.

I've tried it using ActiveX controls for reading the database in SQL Azure (which is the same as reading database in SQL Server). I also enabled all the ActiveX configurations in Internet Explorer (Tools --> Internet Options --> Security --> Custom Levels), but it returned this error:

0x80004005 - JavaScript runtime error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

My code in JavaScript:

function readDB() {
    var connection = new ActiveXObject("ADODB.Connection");
    var connString = "Server=vswughrcjn.database.windows.net;Database=theosqloffice;User ID=xxxxx;Password=xxxx;Trusted_Connection=False;Encrypt=True;";
    connection.Open(connString);
    var rs = new ActiveXObject("ADODB.Recordset");
    rs.Open("SELECT itemcode FROM itemlist", connString);
    rs.MoveFirst
    while (!rs.eof) {
        document.write(rs);
        rs.movenext;
    }

    rs.close;
    connString.close;
}

Now, here are my questions:

  1. Did my connection string to SQL Azure is correct? If it is yes, can I use ADODB connection in connecting my app to SQL Server/Azure using JavaScript?
  2. Is there any way to connect SQL Azure/Server without using the ActiveX? Using the ActiveX just creates hard time for the users to enabling it.

Thanks :)


解决方案

Hi,

Thank you for posting in the MSDN Forum.

I'll consult my colleague on your issue. You'll be informed if there's any update.

Thank you for your patience and understanding.

Best regards,


这篇关于如何通过Apps for Office为SQL Azure创建连接字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆