Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.
After that I just use the $dataset.Tables.Rows to retrieve data. But besides the point. As I stated earlier, the code works fine if the uid and pwd commands are not used.
## Create our object to access Access Table $dataSource = "<.mdb file location>" $strQuery = "SELECT * FROM table" $dsn = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=$dataSource;uid=<username>;pwd=<password>;" ## create connection object and open the database $objConn = New-Object System.Data.OleDb.OleDbConnection $dsn $objCmd = New-Object System.Data.OleDb.OleDbCommand $strQuery,$objConn $objConn.Open() ## get query results, populate data-adapter, close connection $adapter = New-Object System.Data.OleDb.OleDbDataAdapter $objCmd $dataset = New-Object System.Data.DataSet [void] $adapter.Fill($dataSet) $objConn.Close()
An important factor to consider: This Access DB is using linked tables to a Pervasive DB. So the credentials are not to authenticate to Microsoft Access Table/DB, but rather to access the DB on the other server.
Exception calling "Open" with "0" argument(s): "Could not find installable ISAM." At <script location>:56 char:14 + $objConn.Open <<<< () + CategoryInfo : NotSpecified: (:) , MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException Exception calling "Fill" with "1" argument(s): "Could not find installable ISAM." At <script location>:61 char:21 + [void] $adapter.Fill <<<< ($dataSet) + CategoryInfo : NotSpecified: (:) , MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException