VB6 app trying to connect to Azure SQL Database

purpose

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

Attempt

With VB6, I can connect to the 2012 SQL Server hosted by default where I am working using the following connection string:

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

      


However, when we look at the connection string that 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 I am facing problems; I cannot use the same connection string for VB6 . Take a look at my error:

enter image description here


At last...

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

+3


source to share


2 answers


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;"

      

+3


source


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



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

0


source







All Articles