C++ connection to Azure SQL or Microsoft SQL Server - c++

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.

Related

Run a HTTP server in MySQL to receive data from a client

I want to insert a Json content from android cell phone (as client) into my MySQL database (in server). In order that, at first, I send this Json content from my client to my server which runs a HTTP server using Qt application in C++. Next in C++, I call a MySQL stored procedure to insert the received Json into my database. As we see, there is an interface in C++ (HTTP Server) which I'm going to omit it.
I want to know, is there an approach like running HTTP server in MySQL to handle the above process without a HTTP server in C++? (So I can send the Json content from my client to my MySQL database directly.)
No, the MYSQL server does not expose a JSON interface. You'd have to interact with the MSQL server directly using this. So no JSON, but direct SQL queries to your MYSQL server.
If you don't want to do that, a http webserver is not the only option, but it's probably the most sensible solution.

Trying to connect PowerBI to Database sitting on a server

First time I am using PowerBI and trying to get the data source working.
What I am doing to connect at the moment:
Click on 'Get Data'
Select 'SQL Server database'
Where it says Server I enter server(ip address name) and the SQL instance name on the server e.g. 1.1.1.1\MSSQLSERVER
Its weird because sometimes it takes me to the next page where the options displayed are Windows and Database. I have tried using the login I would use on remote connection to get into the server but no luck. It throws the error:
Details: "Microsoft SQL: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 25 - Connection string is not valid)"
What am I doing wrong?

ColdFusion 10 Administrator - Secure DNS

We have a webserver connected to an old database. The old database server is end of life. When we set that up we did not need a secure connection. Now we have a new database on a new database server. Our IT department is requiring this to be a secure connection (even though it's an intranet).
Using ColdFusion Administrator I tried simply editing the URL of the server, but I get this error:
Connection verification failed for data source: xxxxxxxx
java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer
JDBC Driver]The SQL Server login requires an SSL connection. The root
cause was that: java.sql.SQLNonTransientConnectionException:
[Macromedia][SQLServer JDBC Driver]The SQL Server login requires an
SSL connection.
That's when I heard from my IT people that it needs to be a secure connection.
I have no idea how to do that, and Google didn't offer me any help, probably because I don't know what to search for.
Could one of you wonderful people please offer a suggestion on how to create a secure connection from ColdFusion Administrator 10 to MS SQL 2008?
Thank you

Passing Server URL using Variable in Webserver connection manager

I m a newbie, learning SSIS. Currently I am trying to get data from webservice and import it to database table. When establishing the connection to the server. Is it possible to send it using variable instead of hardcoding it in HTTP connection manager Editior?
Right-click on the connection manager and select "Parametrize". The rest of it should be self-explanatory.

Connecting to SQL Server Express 2012 via ODBC from a 32bit C++ App (and TCP/IP)

I have a 32bit app that I am trying to connect to SQL Server Express 2012 via ODBC. I have checked the server and the browser are running. I can connect via windows authentication using the Management Studio Tool. Using the Configuration manager I have started SQL Server Browser (SQL Server Agent is not able to start in Express). I have turned on Pipes and TCP/IP.
I have looked at connections strings .com and tried many combinations including:
"Driver={SQL Server Native Client 11.0}; Server=MyComputer\SQLEXPRESS;Database=AdventureWorks; Trusted_Connection=yes;"
"Driver={SQL Server};Server=.\SQLEXPRESS;Database=AdventureWorks;Trusted_Connection=Yes"
Finally I created a DSN using odbcad32.exe (to avoid the architecture mismatch error) and that works fine. I can connect and execute queries. No luck
ADDED
A string that works:
Driver={SQL Server Native Client 11.0}; Server=INTELXEON\SQLEXPRESS; UID=Development;Trusted_Connection=Yes;WSID=INTELXEON;
ADDED
For TCP/IP connections:
Driver={SQL SERVER Native CLIENT 11.0};SERVER=22.22.22.22\SQLEXPRESS,22222;uid=sa;pwd=yourpassword;app=appname;wsid=INTELXEON
If that saved you hours of work, vote this question up.