We help IT Professionals succeed at work.

restructure connection string for Azure

354 Views
Last Modified: 2017-11-01
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?
Comment
Watch Question

Pawan KumarDatabase Expert
Awarded 2016
Top Expert 2016

Commented:
For any connection string related issues please refer -

https://www.connectionstrings.com/
IT Engineer
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
What changes here?

Set conn = New ADODB.Connection
Set rec = New ADODB.Recordset
Vitor MontalvãoIT Engineer
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
Nothing. What changes is the line where you set the connection string.