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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:16:24+00:00 2026-05-27T19:16:24+00:00

While googling how to convert a BIT (YESNO) column in an access database to

  • 0

While googling how to convert a BIT (YESNO) column in an access database to a checkbox programmatically, a possible solution I found was to copy an existing database’s structure by using DoCmd.
I have added a reference to Microsoft.Office.Interop.Access and added those 2 lines in my code:

using Access = Microsoft.Office.Interop.Access;    
Access.Application myAccessInstance = new Access.Application();

In the try block where I open a connection to my database I’m executing Do.Cmd.TransferDatabase:

myAccessInstance.DoCmd.TransferDatabase(0, "Microsoft Access", "C:\\Users\\user\\Desktop\\Merge\\playlists.MDB", 0, "PlaylistNames",
                "PlaylistNamesCopy", true);

and I get a System.Runtime.InteropServices.COMException:

This operation requires an open database.

Does anyone know what is going wrong?

  • 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-27T19:16:25+00:00Added an answer on May 27, 2026 at 7:16 pm

    I do not know C#, so this is a rough example of how to set a field (column) in a table to a checkbox display, which is what I believe this question to be about.

    //Added reference to COM Microsoft DAO 3.6
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                DAO.DBEngine dbEng = new DAO.DBEngine(); 
                DAO.Workspace ws = dbEng.CreateWorkspace("", "admin", "", DAO.WorkspaceTypeEnum.dbUseJet); 
                DAO.Database db = ws.OpenDatabase("z:\\docs\\dbfrom.mdb", false, false, "");
                DAO.TableDef tdf = db.TableDefs["Test"];
    
                DAO.Field fld = tdf.Fields["AYesNo"];
                //dbInteger  3 
                //accheckbox  106 
                DAO.Property prp = fld.CreateProperty("DisplayControl", 3,106);
                fld.Properties.Append(prp);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

While googling I found two different sets of headers that need to be set
I've been googling for a while now, I found some not complete tutorials how
While googling around for doing more css with less writing and I found this
I found this in some code examples while googling : $sql = 'INSERT INTO
How to configure the jsf mavenized project with hibernate. While googling i found many
I'm running this sample code I found while googling: SELECT MD5(RAND()) But, to my
While googling, I see that using java.io.File#length() can be slow. FileChannel has a size()
While I'm googling/reading for this answer I thought I would also ask here. I
I've been googling for a while now, and can't figure out how to create
I've been googling for a while now and for the life of me can't

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.