Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8874771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:48:25+00:00 2026-06-14T18:48:25+00:00

I have a multi-user Access database which is compacted daily using a powershell script.

  • 0

I have a multi-user Access database which is compacted daily using a powershell script. This script can’t compact the database if there are still users logged in. If there is a user logged in, I would like be able to idenify the user(s) who forgot to logout of the database and remind them to log out at the end of the day.

If I were to write this in VB it would work like this:

Dim cn as ADODB.Connection
Dim rs as ADODB.Recordset
cn.open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=...mdb")
Set rs = cn.OpenSchema(adSchemaProviderSpecific, ,"{947bb102-5d43-11d1-bdbf-00c04fb92675}")

Then loop through the recordset and get the information I want.

What I would like to do is translate this to PowerShell so it can run with the compact script. I have tried the following:

$objCon = New-Object -ComObject ADODB.Connection
$objRs = New-Object -ComObject ADODB.Recordset
$objCon.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=...mdb")
$objRs= $objCon.OpenSchema([ADODB.SchemaEnum]::adSchemaProviderSpecific,$null,'{947bb102-5d43-11d1-bdbf-00c04fb92675}')
$objRs.MoveFirst()

Then loop through the recordset and find the information I need.

The ps code errors out on the OpenSchema line with:

Exception calling “OpenSchema” with “3” argument(s): “Object or provider is not capable of performing requested operation.”
At FindUsers.ps1:8 char:27
+ $objRs= $objCon.OpenSchema <<<< ([ADODB.SchemaEnum]::adSchemaProviderSpecific,$null,'{947bb102-5d43-11d1-bdbf-00c04fb92675}’)
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException

The script won’t execute if I remove the middle $null variable or replace it with ”, and I don’t know if the command is translated from VB to powershell correctly. I’ve searched on Google and SO and haven’t found any solutions. What do I need to do to use the OpenSchema command?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T18:48:26+00:00Added an answer on June 14, 2026 at 6:48 pm

    This works for me using the newer ACE drivers included with Office 2007 and higher:

    $filepath = "C:\Users\u00\Documents\Northwind.mdb"
    [guid]$guid = '947bb102-5d43-11d1-bdbf-00c04fb92675'
    
    $ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=`"$filepath`";Persist Security Info=False;"
    $conn = new-object System.Data.OleDb.OleDbConnection($ConnectionString)
    $conn.open()
    $conn.GetOleDbSchemaTable($guid,$null) 
    $conn.close()
    
    COMPUTER_NAME                    LOGIN_NAME 
    -------------                    ---------- 
    Z002                             Admin   
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have an order which has order lines and we have a multi-user
I have a multi-line text view that can get quite large. When the user
I have the following multi-select box in a HTML form, where user can select
I'm using 'rails3-jquery-autocomplete' gem, but it doesn't have multi column search, but there is
I'm working on a multi-user, multi-account App where 1 account can have n users.
I am building a multi-user web application. Each user can have their own site
We have multi user frontend/backend MS Access 2010 application. We added a process that
okay, i'm setting up a multi-user chat system. i have a messages table, that
I have a multi-step order form built in this manner: Step 1: Choose category
We have a multi-tenant system with multiple different levels of access--sometimes even for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.