10

I have to support a VB6 application that is still in production (ugh). A customer is specifying our software needs to be PCI compliant which requires TLS 1.2.

Anyone know how to do this?

I am using SQL Server 2014. I'm patched to build 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

The project is referencing "Microsoft ADO Ext. 6.0 for DDL and Security" and "Microsoft ActiveX Data Objects 2.5 Library"

I have tried multiple connection string options.

Thanks!

FatherOfDiwaffe
  • 300
  • 1
  • 2
  • 12
  • 2
    ADOX is a Jet-only library. In any case you need to make use of a newer SQL Server Native Client or equivalent supporting TLS 1.2, that isn't a VB6 responsibility but a SQL Server issue. – Bob77 Mar 31 '17 at 17:52
  • That makes sense. The question remains then what object to reference with the sql updates installed. I did find some support on the [Microsoft site](https://support.microsoft.com/en-us/help/3154518/support-for-tls-system-default-versions-included-in-the-.net-framework-3.5.1-on-windows-7-sp1-and-server-2008-r2-sp1). However it isn't clear which object to use now. – FatherOfDiwaffe Apr 03 '17 at 18:58
  • Most of the ADO interface changes after 2.5 were for SQL Server and a few apply to Oracle. But unless you make use of them in your code ADO 2.5 works fine. If you are asking about the Provider and the rest of the connection string then consult the SQL Server documentation. – Bob77 Apr 04 '17 at 08:27

1 Answers1

19

I found the answer in 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

Changing the provider to SQLNCLI11 and adding DataTypeCompatibility=80 worked.

Mike G
  • 4,232
  • 9
  • 40
  • 66
FatherOfDiwaffe
  • 300
  • 1
  • 2
  • 12