


# if DSN attributes have been changed in the new driver version # You can change the property array as well, Example 4: Migrates DSNs to a newer version of a driver PS C:\> $DsnArray = Get-OdbcDsn -DriverName 'SQL Server Native Client 10.0' Without PassThru, the cmdlet does not return anything. The command includes the PassThru parameter.

This command adds the ODBC System DSNs named MyPayroll that use SQL Server Native Client 10.0 with the specified DSN properties, and then stores the results in the $NewDsn variable. Example 3: Add and store an ODBC System DSN PS C:\> $NewDsn = Add-OdbcDsn -Name "MyPayroll" -DriverName "SQL Server Native Client 10.0" -DsnType "System" -SetPropertyValue "Trusted_Connection=Yes", "Database=Payroll") -PassThru This command adds the ODBC System DSNs named MyPayroll that use SQL Server Native Client 10.0 with the specified DSN properties.īecause the command does not include the Platform parameter, the platform architecture is the default, native platform. Example 2: Add an ODBC System DSN PS C:\> Add-OdbcDsn -Name "MyPayroll" -DriverName "SQL Server Native Client 10.0" -DsnType "System" -SetPropertyValue "Trusted_Connection=Yes", "Database=Payroll") This command adds a 32-bit ODBC User DSN named MyPayroll that uses the specified 32-bit driver with the specified properties. Examples Example 1: Add a 32-bit ODBC User DSN PS C:\> Add-OdbcDsn -Name "MyPayroll" -DriverName "Microsoft Access Driver (*.mdb, *.accdb)" -DsnType "User" -Platform "32-bit" -SetPropertyValue 'Dbq=C:\mydatabase.accdb'
#ODBC MANAGER CANNOT ADD NEW SYSTEM DSN DRIVERS#
You can specify the properties of the DSN by using the SetPropertyValue parameter.ĭo not use the Set-OdbcDsn cmdlet to add a new DSN.įor more information about ODBC, data source names, and drivers, see Microsoft Open Database Connectivity (ODBC), Data Sources, and Drivers on the Microsoft Developer Network. The Add-OdbcDsn cmdlet adds an Open Database Connectivity (ODBC) data source name (DSN) to the computer.
