C + +连接到Azure SQL或Microsoft SQL Server [英] C++ connection to Azure SQL or Microsoft SQL Server

查看:253
本文介绍了C + +连接到Azure SQL或Microsoft SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的C ++代码建立一个数据库的连接;但是,我不确定如何这样做。我的数据库是Azure SQL,它使用微软的sql server作为后端。有人可以向我提供一个网站或代码,以便执行与服务器名称,数据库名称,用户名和密码的连接?



谢谢

解决方案

要查找连接字符串,请首先登录



对于连接到Azure SQL数据库的c ++代码示例,可以参考本文 https://msdn.microsoft.com/en-us/magazine/dn630643.aspx ,请使用数据库的ODBC连接字符串。 / p>

I am trying to establish a connection to a database in my C++ code; however, I am unsure how to do so. My database is Azure SQL which uses microsoft sql server as the backend. Could someone provide me a website or code that executes the connection with the server name, database name, username, and pass?

Thank you

解决方案

To find the connection string, first login to Azure portal, then click your database > Show database connection strings, and you'll see the connection strings for ADO.NET, ODBC, PHP, JDBC.

For c++ code sample of connecting to Azure SQL Database, you can refer to this article https://msdn.microsoft.com/en-us/magazine/dn630643.aspx , use the ODBC connection string of your database.

这篇关于C + +连接到Azure SQL或Microsoft SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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