Sunday, November 27, 2016

How to make an ADO Connection to SQL Server

Microsoft continuos updates the drivers for ADODB so depending on which version of SQL use: '

Dim Cnxn As ADODB.Connection
Open connection strCnxn = "Provider='sqloledb';Data Source='MySqlServer';" & _ "Initial Catalog='Pubs';Integrated Security='SSPI';" 
 Set Cnxn = New ADODB.Connection 
 Cnxn.Open strCnxn

No comments: