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 4619212
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:23:37+00:00 2026-05-22T02:23:37+00:00

I am trying to script access to an Access database for use on the

  • 0

I am trying to script access to an Access database for use on the command line. The Access database is secured with a workgroup file.

Dim oApp, sWGF,myWS
Set sApp = CreateObject("Access.Application")
set sWGF = "C:\Users\Alan\Documents\Secured.mdw"
oApp.DBEngine.SystemDb = sWGF
WScript.echo "Workgroup " & sWGF
WScript.echo "SystemDb " & oApp.DBEngine.SystemDb
Set myWS = oApp.DBEngine.CreateWorkspace("New","Name","Password")

This code outputs the Secured.mdw filename for the workgroup, but the default System.mdw filename for the SystemDB as the output from the two WScript.echo commands. It also fails to create the workspace saying the Name and Password are wrong (although they ARE correct for the Secured.mdw file)

There are lots of references elsewhere on the net that say you can only do this as the first thing inside an application, but that IS what I am doing.

I am not sure what I am doing wrong. Any ideas

  • 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-05-22T02:23:38+00:00Added an answer on May 22, 2026 at 2:23 am

    I think you should be using DAO and Jet directly, instead of automating Access.

      Dim objEngine
      Dim strWorgroup
      dim wrkWorkspace
      Dim db
    
      Set objEngine = CreateObject("DAO.DBEngine.36")
      objEngine.SystemDB = "C:\Users\Alan\Documents\Secured.mdw"
      Set wrkWorkspace = objEngine.CreateWorkspace("", "Name", "Password")
      Set db = wrkWorkspace.OpenDatabase("C:\MyDatabase.mdb")
    

    This would bypass Access itself and use the Jet database engine directly, which seems simpler to me.

    In testing this, I had some difficulty setting the SystemDB as well, but it turned out I just had to make sure I was providing a VALID one for use. The first non-default one I tried didn’t work, but when I made a copy of the default one and used that, it worked.

    So, I’d look to see if you’ve got the correct filename/path for your workgroup file, if it’s the right version of Jet, and if you’ve got the appropriate NTFS permissions to open it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to connect to an access database from a php script using ODBC.
I am trying to update an Access database with a vb script by putting
I'm playing around with the Win32::IE::Mechanize. I'm trying a script to automatically access six
im trying to create a script that opens a file and replace every 'hola'
I've written a PHP script to access the latest item from the wordpress database,
I'm trying to write a PHP script to backup a MySQL database: if (
I am trying to access MySQL stored procedures from a perl script but I
I am trying to programmatically remove rows from a Microsoft Access Database using a
I'm currently trying to write a script to migrate the database from a proprietary
I am trying to execute a database script I created through the Forward Engineer

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.