Optional: Enter information in the Description field if you want to include it. Enter a name in the Data Source Name field. Select IBM Informix ODBC Driver, and click OK. This command works for the SQL Server Native Client ODBC driver. To create and configure an Informix DSN on Mac OS X: Open the ODBC Administrator by choosing Applications > Utilities > ODBC Administrator. The second command uses the ForEach Windows PowerShell keyword to step through each member of $DsnArray.įor each member, the command uses the current cmdlet to migrate DSNs using the SQL Server Native Client 10.0 driver to a newer version of that driver. The first command gets ODBC data source names by using the Get-OdbcDsn cmdlet, and then stores them in the $DsnArray variable. PS C:\> Add-OdbcDsn -Name $Dsn.Name -DsnType $Dsn.DsnType -Platform $Dsn.Platform -DriverName 'SQL Server Native Client 12.0' -SetPropertyValue $Dsn.PropertyValue # 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. Also, you can specify a CacheLocation to store the metadata of your OData organization. Connecting to OData To connect, you need to set the Url to a valid OData service root URI in addition to the authentication values. 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 To create your own DSN, instead click Add on the User or System tab and then select the CData ODBC Driver for OData option. 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' 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |