Difficulty connecting VB6 projects to the Database on using Availability Group Listener in the Connection string

Asked

Viewed 49 times

0

Our scenario is using MSSQL database configured for High Availability and Listener was created to link the balance between instances. Some applications made in Asp.Net MVC projects we managed to make connection by changing the Web config and applying a user on IIS.

Example of the Web.config that works:

<add name="ContextEntities" connectionString="Data Source=tcp:AGListener,60236;Initial Catalog=ClienteDB;persist security info=True;integrated security=true;MultipleActiveResultSets=True;" providerName="System.Data.SqlClient"/>

How to make this connection in VB6 projects?

Example of what’s on VB6 today:

Set cnBD = New ADODB.Connection
cnBD.CommandTimeout = 0
        With cnBD
             .Provider = "SQLOLEDB"
             .ConnectionString = "USER ID=USUARIO;password=P@SSW0RD; data source = ClienteServer;Initial catalog = ClienteDB"
             .Open
        End With
  • in vb can also use the integrated security=true, the credentials of the user running the application will be used in vb

  • It would be interesting, but would have to create the credentials of all users in the instance of sql server?

  • can be simpler than this if users are logged in to the Windows domain. You can add users to a group and give SQL permission to that group instead of each user individually

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.