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. Convert mdb to xml

Convert mdb to xml

Scheduled Pinned Locked Moved C#
csharpjavaxmlquestion
6 Posts 5 Posters 0 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
    a hamidy
    wrote on last edited by
    #1

    Dear All, I am looking to convert .mdb access file into xml file using c#. I have googled,but i didnt find any topic related. I am sure about java which does this conversion, but i dont know about c#. such features is available in c# or not?

    G 1 Reply Last reply
    0
    • A a hamidy

      Dear All, I am looking to convert .mdb access file into xml file using c#. I have googled,but i didnt find any topic related. I am sure about java which does this conversion, but i dont know about c#. such features is available in c# or not?

      G Offline
      G Offline
      Garth J Lancaster
      wrote on last edited by
      #2

      Member 6059028 wrote:

      such features is available in c# or not?

      you mean as an inbuilt command export_mdb_to_xml() ?? er, no you'd have to write code that "- either reads a single table or loops through the tables in an mdb, read each row in the (current) table, export each field in row as xml 'g'

      A R 2 Replies Last reply
      0
      • G Garth J Lancaster

        Member 6059028 wrote:

        such features is available in c# or not?

        you mean as an inbuilt command export_mdb_to_xml() ?? er, no you'd have to write code that "- either reads a single table or loops through the tables in an mdb, read each row in the (current) table, export each field in row as xml 'g'

        A Offline
        A Offline
        a hamidy
        wrote on last edited by
        #3

        conversion in a table level is simply done using DataTable methods. but i am looking to fully convert .mdb file into .xml file, including all object in .mdb file.

        R R 2 Replies Last reply
        0
        • A a hamidy

          conversion in a table level is simply done using DataTable methods. but i am looking to fully convert .mdb file into .xml file, including all object in .mdb file.

          R Offline
          R Offline
          Reza Raad
          wrote on last edited by
          #4

          Use SSIS(Sql Server Integration Services) this service has powerfull abilities for transfering full database or database objects to another database server. You must install sql server 2005 or 2008 and then use this service.

          Human knowledge belongs to the world http://www.rad.pasfu.com/index.php

          1 Reply Last reply
          0
          • G Garth J Lancaster

            Member 6059028 wrote:

            such features is available in c# or not?

            you mean as an inbuilt command export_mdb_to_xml() ?? er, no you'd have to write code that "- either reads a single table or loops through the tables in an mdb, read each row in the (current) table, export each field in row as xml 'g'

            R Offline
            R Offline
            Ramkithepower
            wrote on last edited by
            #5

            Hey, If you would like to use a dataset and if you are not trying to write the XML document in any specific format, try this. constr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\db.mdb;"; OleDbConnection conn = new OleDbConnection(constr); conn.Open(); DataSet ds=new DataSet(); OleDbDataAdapter da = new OleDbDataAdapter(); OleDbCommand dcmd=new OleDbCommand("select * from table",conn); da.SelectCommand = dcmd; da.Fill(ds); XmlDocument xld = new XmlDocument(); ds.WriteXml("xmlpath");

            Jack Sparrow -------------------------------------- Defeat is not the worst of failures. Not to have tried is the true failure.

            1 Reply Last reply
            0
            • A a hamidy

              conversion in a table level is simply done using DataTable methods. but i am looking to fully convert .mdb file into .xml file, including all object in .mdb file.

              R Offline
              R Offline
              riced
              wrote on last edited by
              #6

              If I remember correctly (not used Access for about 5 years) you can get this information from the MSysAccessObjects table - you may need to look at other MSys* tables as well. You can see what there is by going to Tools|Options and turning on 'Show System Objects' in Access. Of course you'ld have to iterate through these and through whatever table/queries/Reports/Modules you're interested in. (Do you really want to convert VBA code in Modules?)

              Regards David R

              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