TLS1.2 的 VB6 应用程序 ado 连接

VB6 application ado connection for TLS1.2

我必须支持仍在生产中的 VB6 应用程序(呃)。一位客户指定我们的软件需要符合 PCI 标准,这需要 TLS 1.2。

有人知道怎么做吗?

我正在使用 SQL Server 2014。我已修补以构建 12.0.4502.0。

Public Function GetConnection() As ADODB.Connection
  Dim con As ADODB.Connection

  On Error Resume Next
  Set con = New ADODB.Connection
  con.ConnectionTimeout = 10

  Dim connstring As String
  'connstring = "Provider=SQLOLEDB;Server=" & gstrServer & ";Database=" & gstrDB & ";User Id=" & gstrUser & ";Password=" & gstrPwd
  connstring = "Provider=MSDASQL;DRIVER=Sql Server;Server=" & gstrServer & ";Database=" & gstrDB & ";UID=" & gstrUser & ";PWD=" & gstrPwd

  con.Open connstring

  If Err Then Set con = Nothing
  Set GetConnection = con
End Function

该项目正在引用 "Microsoft ADO Ext. 6.0 for DDL and Security" 和 "Microsoft ActiveX Data Objects 2.5 Library"

我尝试了多个连接字符串选项。

谢谢!

我在 Using ADO with SQL Server Native Client 中找到了答案。

To enable the usage of SQL Server Native Client, ADO applications will need to implement the following keywords in their connection strings:

Provider=SQLNCLI11

DataTypeCompatibility=80

The following is an example of establishing an ADO connection string that is fully enabled to work with SQL Server Native Client, including the enabling of the MARS feature:

 Dim con As New ADODB.Connection

 con.ConnectionString = "Provider=SQLNCLI11;" _  
         & "Server=(local);" _  
         & "Database=AdventureWorks;" _   
         & "Integrated Security=SSPI;" _  
         & "DataTypeCompatibility=80;" _  
         & "MARS Connection=True;"   
con.Open

将提供程序更改为 SQLNCLI11 并添加 DataTypeCompatibility=80 有效。