restructure connection string for Azure

In order to open a connection on my VB6 app, I use the following info:

Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset


conn.Open "Provider=sqloledb;Data Source=" & ConnectionIP & ",1433;Network Library=DBMSSOCN;Initial Catalog= xxxxxxxx; User ID=xx;Password=xxxx"

However, if I was going to use Microsoft Azure SQL database, I will need to change this connection string.  They provide  ADO.NET, JDBC, ODBC and PHP connection strings.  None of those are similar to what I'm using now, so what changes would I have to make in order to make this connection work?  I'm guessing that ODBC would be the choice which looks like this:

Driver={ODBC Driver 13 for SQL Server};Server=tcp:xxxxxxx,1433;Database=xxxxx;Uid=xxxxxx;Pwd={your_password_here};Encrypt=yes;TrustServerCertificate=no;Connection Timeout=30;


How would I structure this in VB6 to connect?
al4629740Asked:
Who is Participating?
 
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
Do you have access to the SQL Azure subscription where the database is? If so you can get the connection string from there and it even allows you to copy it so you can paste it in your application:
SQLAzure_ConnectionString.PNG
But basically is something like this:
Server=tcp:sqlazureservername.database.windows.net,1433;Initial Catalog=SQLAzureDBname;Persist Security Info=False;User ID={your_username};Password={your_password};MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;
0
 
Pawan KumarDatabase ExpertCommented:
For any connection string related issues please refer -

https://www.connectionstrings.com/
0
 
al4629740Author Commented:
What changes here?

Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
0
 
Vitor MontalvãoMSSQL Senior EngineerCommented:
Nothing. What changes is the line where you set the connection string.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.