Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to create mdb File?

How to create mdb File?

Scheduled Pinned Locked Moved C#
questioncsharpcsshelptutorial
8 Posts 4 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Admin887
    wrote on last edited by
    #1

    How Can i create mdb file, create some table in it(columns..), and add some rows?(in C#) after it, i want to show the file in DataGridView.. But i dont know how to do it..How to open mdb file and show it in the grid? Someone can help me plz? it is for my huge Project? Thank you!

    G P 2 Replies Last reply
    0
    • A Admin887

      How Can i create mdb file, create some table in it(columns..), and add some rows?(in C#) after it, i want to show the file in DataGridView.. But i dont know how to do it..How to open mdb file and show it in the grid? Someone can help me plz? it is for my huge Project? Thank you!

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      Issue a script that creates a database. Issue a script that creates a table. Issue a script that inserts some data. Read the data from the table and show on a grid.

      Giorgi Dalakishvili #region signature my articles #endregion

      A 1 Reply Last reply
      0
      • G Giorgi Dalakishvili

        Issue a script that creates a database. Issue a script that creates a table. Issue a script that inserts some data. Read the data from the table and show on a grid.

        Giorgi Dalakishvili #region signature my articles #endregion

        A Offline
        A Offline
        Admin887
        wrote on last edited by
        #3

        :( i think that it was not necessary :(

        1 Reply Last reply
        0
        • A Admin887

          How Can i create mdb file, create some table in it(columns..), and add some rows?(in C#) after it, i want to show the file in DataGridView.. But i dont know how to do it..How to open mdb file and show it in the grid? Someone can help me plz? it is for my huge Project? Thank you!

          P Offline
          P Offline
          paas
          wrote on last edited by
          #4

          Unfortunately you can not create Access MDBs using ADO.Net, but you can use COM and ADOX to create the database and tables, and then access the created MDB and tables via ADO.Net and OleDB. The link below, although a VB.Net example, should help you get started. Create Access MDB and Tables in .NET

          A 1 Reply Last reply
          0
          • P paas

            Unfortunately you can not create Access MDBs using ADO.Net, but you can use COM and ADOX to create the database and tables, and then access the created MDB and tables via ADO.Net and OleDB. The link below, although a VB.Net example, should help you get started. Create Access MDB and Tables in .NET

            A Offline
            A Offline
            Admin887
            wrote on last edited by
            #5

            thank you but.. It it for Visual Basic...:(.. and i am programming in C#. the catalog object do not exist What i need to do?

            D 1 Reply Last reply
            0
            • A Admin887

              thank you but.. It it for Visual Basic...:(.. and i am programming in C#. the catalog object do not exist What i need to do?

              D Offline
              D Offline
              DaveyM69
              wrote on last edited by
              #6

              Add a reference to the Microsoft ADO Ext (it's a COM object) to your project. In the version I have (2.8) the Catalog is actually called CatalogClass. To test it, I converted the first part of the code to this which works.

              ADOX.CatalogClass cat = new CatalogClass();
              cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" +
              @"Data Source=C:\NewMDB.mdb;" +
              "Jet OLEDB:Engine Type=5");
              Console.WriteLine("Database Created Successfully");
              cat = null;

              Now you should be able to convert the rest and ammend it to suit your needs.

              Dave

              modified on Sunday, July 13, 2008 2:59 AM

              A 1 Reply Last reply
              0
              • D DaveyM69

                Add a reference to the Microsoft ADO Ext (it's a COM object) to your project. In the version I have (2.8) the Catalog is actually called CatalogClass. To test it, I converted the first part of the code to this which works.

                ADOX.CatalogClass cat = new CatalogClass();
                cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;" +
                @"Data Source=C:\NewMDB.mdb;" +
                "Jet OLEDB:Engine Type=5");
                Console.WriteLine("Database Created Successfully");
                cat = null;

                Now you should be able to convert the rest and ammend it to suit your needs.

                Dave

                modified on Sunday, July 13, 2008 2:59 AM

                A Offline
                A Offline
                Admin887
                wrote on last edited by
                #7

                Thank you!! i have another question, and sorry for my foolishness, How can i add reference to the Microsoft ADO Ext???

                D 1 Reply Last reply
                0
                • A Admin887

                  Thank you!! i have another question, and sorry for my foolishness, How can i add reference to the Microsoft ADO Ext???

                  D Offline
                  D Offline
                  DaveyM69
                  wrote on last edited by
                  #8

                  Right click on References in Solution Explorer and choose Add Reference. Click the COM tab and you'll find it in the list.

                  Dave

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups