Add-OdbcDsn

I wrote a few odbc articles using ODBCCONF in my blog, so I edit them because ODBCCONF will be removed; read https://docs.microsoft.com/en-us/sql/odbc/odbcconf-exe Using Powershell Add-OdbcDsn is much easier PS> remove-OdbcDsn -name DB01 -dsntype User PS> Add-OdbcDsn -name DB01 -DriverName   "Oracle in client12201" -DsnType "User"   -SetPropertyValue @("Server=DB01") PS> Get-OdbcDsn Name       : DB01 DsnType    : User Platform   : […]

powershell odbc sybase

Oracle goes there ==> …/oracle-odbc-hello-world-with-powershell.html To test Sybase ODBC driver with Powershell, it’s not much different configure the DsN with odbcconf or %SYSTEMROOT%\SysWOW64\odbcconf for the 32bits drivers under Windows 64. cmd /c "%SYSTEMROOT%\SysWOW64\odbcconf.exe /a {configdsn ""Adaptive Server Enterprise"" ""DSN=helloworld|database=mydb|port=25000|server=srv01""}" The name of the driver is important. It is probably also called “Adaptive Server Enterprise” on […]

ODBC 32bits for Windows 64bits

Windows-On-Windows 64-bit (WOW64) enables you to run 32bits applications in 64bits OS. You will see there is another powershell, another registry, another ODBC tool, another Oracle client. %SYSTEMROOT%\syswow64\WindowsPowerShell\v1.0\powershell.exe First, we run powershell(x86) Get-itemproperty HKLM:\SOFTWARE\ORACLE\*| Select-Object ORACLE_HOME,ORACLE_HOME_NAME ORACLE_HOME                                                 ORACLE_HOME_NAME ———–                                                 —————- C:\oracle\product\11.2.0\client_32                          client32bit_11203 Only the Oracle 32bit client is displayed cmd /c "%SYSTEMROOT%\syswow64\odbcconf.exe /a {configdsn ""Oracle in […]

Oracle ODBC hello world with powershell

Demo : cmd /c "odbcconf.exe /a {configdsn ""Oracle in OraClient11g_home1"" ""DSN=helloworld|SERVER=DB01""}" Create a helloworld data source connecting to your DB01 tns alias in your OraClient11g_home1 Oracle Home. It is easy to get the Oracle Home name with Get-itemproperty HKLM:\SOFTWARE\ORACLE\*| Select-Object ORACLE_HOME,ORACLE_HOME_NAME ORACLE_HOME                                       ORACLE_HOME_KEY ———–                                       ————— C:\oracle\product\11.1.0\client_1                 OraClient11g_home1 C:\oracle\product\11.2.0\client_1                 OraClient11g_home2 Then we create the connection (as […]