Hi All,
I have a PowerShell script that queries an Oracle Oracle 9.2 database and runs on my 64-bit PC. I am trying to move it across to a 32-bit PC (both are running Windows 7).
When i try running it on the 32-bit PC the following error is caught.
Exception calling ".ctor" with "1" argument(s): "The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception."
The PowerShell Script is as follows
$reader = $null
Add-Type -Path "C:\PScripts\FeastBCfiles\oracle.dataaccess.dll"
$con = New-Object Oracle.DataAccess.Client.OracleConnection("DETAILS HERE")
$con.Open()
$OracleSQLQuery = "QUERY HERE"
$command = New-Object Oracle.DataAccess.Client.OracleCommand($OracleSQLQuery,$con)
$reader=$command.ExecuteReader()
Any ideas why this is happening? Do i need to install Oracle Data Access Components (ODAC) for Windows 11.2 on my 32-bit PC? It is installed on my 64bit PC but on the 32bit PC i have just made sure that the appropriate dll is being used.
Many Thanks