Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Add-KofaxOdbc {
- <# Supply a value for Name, and this function adds a User DSN ODBC 64-bit connection for it
- #>
- [CmdletBinding()]
- Param (
- [parameter(Mandatory=$True)]
- [string]$Name
- )
- $propertyValue = @"
- System=172.23.1.1
- DefaultLibraries=QGPL
- DefaultPkgLibrary=QGPL
- LanguageID=ENU
- DefaultPackage=QGPL/DEFAULT(IBM),2,0,1,0,512
- QueryStorageLimit=-1
- CommitMode=2
- Naming=0
- DateFormat=5
- DateSeparator=1
- TimeFormat=0
- TimeSeparator=0
- TimestampFormat=0
- Decimal=0
- ExtendedDynamic=1
- BlockSizeKB=8192
- ForceTranslation=0
- LazyClose=0
- LibraryView=0
- ODBCRemarks=0
- ConnectionType=0
- SortSequence=0
- PreFetch=1
- SortWeight=0
- SSL=2
- Signon=3
- ExtendedType=0
- SearchPattern=1
- AllowDataCompression=1
- AllowUnsupportedChar=0
- BlockFetch=1
- Concurrency=0
- MaxFieldLength=15360
- Trace=0
- CCSID=0
- TranslationOption=0
- UnicodeSQL=0
- TrueAutoCommit=0
- DB2SQLStates=0
- Graphic=0
- AllowProcCalls=0
- ExtendedColInfo=0
- CatalogOptions=3
- CursorSensitivity=0
- XATransactionTimeout=0
- XALockTimeout=0
- XALooselyCoupledSupport=1
- HexParserOpt=0
- MaximumDecimalPrecision=31
- MaximumDecimalScale=31
- MinimumDivideScale=0
- ConvertDateTimeToChar=0
- ReportDataTypes=1
- DelimitNames=0
- QueryOptimizeGoal=0
- DecFloatRoundMode=0
- MapDecimalFloatDescribe=1
- DecfloatErrorOption=0
- QueryTimeout=1
- ConcurrentAccessResolution=0
- XMLCurrentImplicitParse=0
- XMLDeclarationFormat=7
- Debug=0
- SQLConnectPromptMode=0
- "@
- $dsn_splat = @{
- Name = $Name
- DriverName = "iSeries Access ODBC Driver"
- DsnType = "User"
- Platform = "64-bit"
- SetPropertyValue = $propertyValue
- }
- Add-OdbcDsn @dsn_splat
- # This property stays at 256 for some reason unless changed as below
- Set-ItemProperty -Path "HKCU:\Software\ODBC\ODBC.INI\$Name" -Name "BlockSizeKB" -Value 8192
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement