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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:38:28+00:00 2026-05-27T00:38:28+00:00

Cannot open the MS Office Access database engine workgroup information file – When I

  • 0

Cannot open the MS Office Access database engine workgroup information file – When I have code as posted.

What I am trying to do in my code is to create MS Access 2007 file and then set the user name and password to it from my program. What am I doing wrong here?

Error occurs here: objOleDbConnection.Open();

EDIT: I have made some changes, seems like it opens a connection but the command is incorrect.

Now problem is here:

        objOleDbCommand.CommandText = 
            "ALTER USER " + storedAuth.UserName + 
            " PASSWORD [" + storedAuth.Password + "] []";

The entire code:

    // Creating an object allowing me connecting to the database.
    OleDbConnection objOleDbConnection = new OleDbConnection();
    objOleDbConnection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" +
            "Data Source=" + sfdNewFile.FileName + ";Persist Security Info=False";
    // Creating command object.
    OleDbCommand objOleDbCommand = new OleDbCommand();
    objOleDbCommand.Connection = objOleDbConnection;

    try
    {
        objOleDbConnection.Open();
        objOleDbCommand.CommandText = "ALTER USER " + 
                    storedAuth.UserName + " PASSWORD [" + 
                    storedAuth.Password + "] []";
        objOleDbCommand.ExecuteNonQuery();
    }
    catch (Exception ex)
    {
        // Displaying any errors that 
        // might have occured.
        MessageBox.Show("Error: " + ex.Message);
    }
    finally
    {
        objOleDbConnection.Close();
    }
  • 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-27T00:38:29+00:00Added an answer on May 27, 2026 at 12:38 am

    To change an Access DB password, you must it open in exclusive mode. Try adding this to your connection string ;Exclusive=1.

    createMSFile.Create("Provider=Microsoft.ACE.OLEDB.12.0;Exclusive=1;Data Source=" +
            sfdNewFile.FileName);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have an access mdb file that was originally create using Access 2003/Office
I have a CSV export script (enrdata_arch.php) which calls information from an existing database
In my asp page, I have to open a csv file in IE by
I am attempting to connect to an Access 2000 database file (*.mdb), but I
I cannot open a .php file in Aptana studio editor, it gives me this
I am trying to open an InfoPath 2007 file programmatically from a Windows service,
In C++ (specifically on Visual C++), sometimes you cannot open a file because another
I have my code as follows :- Microsoft.Office.Interop.Excel.Application oXL = null; Microsoft.Office.Interop.Excel.Sheets sheets; Application
Error 1 fatal error LNK1104: cannot open file 'C:\Users\hongo\Documents\VisualStudio2008\Projects\PruebaNodosLcmasmas\Debug\PruebaNodosLcmasmas.exe' PruebaNodosLcmasmas PruebaNodosLcmasmas This error happens
I cannot open an existing website in MonoDevelop. I have tried various options with

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.