Alex
Alex

Reputation: 4938

VB6 Application Trying to Connect to Azure SQL Database

Goal

We have VB.Net applications currently running and communicating with our cloud database hosted by Microsoft's Azure portal. However, we have some VB6 applications that we would like to do the same.

Attempt

With VB6, I am able to connect to a 2012 SQL Server that is hosted on premiss where I work using the following connection string:

sConnectionString = "Provider=SQLNCLI11;Server=MYSERVERNAME;Database=MYDATABASE;Uid=USERNAME;Pwd=PASSWORD;"

However, when we take a look at the connection string I use in VB.Net to connect to the cloud;

sConnectionString = "Server=tcp:SERVER.database.windows.net,1433;Initial Catalog=MYDATABASE;Persist Security Info=False;User ID=USERNAME;Password=PASSWORD;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"

That's where I run into problems; I cannot use the same connection string for VB6. Take a look at my error:

enter image description here


Finally...

Do we need to upgrade all our VB6 programs to VB.Net? Or perhaps I am missing a reference for my project to work with Azure? Is it even possible for a VB6 app to communicate with Azure?

Upvotes: 3

Views: 3481

Answers (2)

Alex
Alex

Reputation: 4938

After messing around with many different connection strings I finally found one that connected:

sConnectionString = "Provider=SQLNCLI11;Password=PASSWORD;User ID=USER@SERVERNAME;Initial Catalog=DATABASE;Data Source=tcp:SERVERNAME.database.windows.net;"

Upvotes: 3

Giorgio Brausi
Giorgio Brausi

Reputation: 414

See ConnectionStrings.com and try with OLE DB or ODBC settings:

https://www.connectionstrings.com/sql-azure/

Upvotes: 0

Related Questions