|
From: Jakob E. <jab...@gm...> - 2016-01-12 21:23:09
|
MSysObjects just tells you the name, type, etc. of the table. You can ignore it if you just want to read the data. If you want to read the records, you need information from the tdef page. The tdef pages tell you how what fields are in a table, what types they have, and so on. You need that information to read the data pages. What does a data page look like? Well, it has a header that tells you what table it belongs to (table id = index of the tdef page). Then it is filled with records, starting from the end. The header stores the offsets of the records. What do records look like? Each record has all the fixed length fields in the front (use info from tdef page to parse). All the variable length fields are at the end, starting from the back. You could actually parse variable length fields without the info from the tdef page (at least text columns). The NULL map (which fields are NULL) is also stored at the end of the record. How do you find data pages for a specific table? 1) Look at the page usage bitmap for the table (complicated) 2) Just loop through all pages in the file and look at the table id (easy, fast enough for all but the largest databases) Hope this helps a little. Reading MDB files is unfortunately not trivial. Jakob > On 12 Jan 2016, at 13:16, Yannick Heinrich <yan...@gm...> wrote: > > Hello again :) > > I'm moving forward with my go library and I have arrived at the point where I need to read the records from the > data pages. > > From what I understood by reading the source code of libmdb, all the secrets are contained in the MSysObjects table. > > Is there a good reference or description of the MSysObjects table and object ? What is the basic approach ? > > > Regards > Yannick Heinrich > > > > 2015-12-14 13:34 GMT+01:00 Yannick Heinrich <yan...@gm... <mailto:yan...@gm...>>: > Hello, > > I'm currently trying to create a small Go tool that could deal with mdb files. > > I'm currently reading the HACKING file at https://github.com/brianb/mdbtools/blob/master/HACKING <https://github.com/brianb/mdbtools/blob/master/HACKING> to be able to decode a Jet4 file for now. > > I don't really understand the definition of tdef_pg in the data page section. > > Is it the index of the page within the whole file ? Is it an offset relative to the beginning of the file ? > > I fall on this page speaking about tdef_pg on sourceforge : http://sourceforge.net/p/mdbtools/mailman/message/3267842/ <http://sourceforge.net/p/mdbtools/mailman/message/3267842/> > > I created a small program printing all the headers of the data pages and I did not get the offset mentionned in this page. > Moreover, on this page, a page_id is mentioned but no trace in the HACKING file. > > Could someone give me more information about the tdef_pg pointer and more generally, > how is a data definition page found from the data page header ? > > Yannick > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > mdbtools-dev mailing list > mdb...@li... <mailto:mdb...@li...> > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev <https://lists.sourceforge.net/lists/listinfo/mdbtools-dev> > > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140_______________________________________________ > mdbtools-dev mailing list > mdb...@li... > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev |