Using the Properties Collection
You can also set the required four properties using the properties collection. See the following sample Visual Basic program:
Example – Visual Basic
Dim TeraCnxn As New ADODB.Connection
With TeraCnxn
.Provider = "TDOLEDB"
.Properties("Data Source") = "Teradata1"
.Properties("User Id") = "userid"
.Properties("Password") = "password"
.Properties(“Extended Properties”)= “SESSIONMODE=TERADATA;”
.Open
End With