Re: (no subject)
Jakob Egger <[email protected]> Tue, 12 Jan 2016 22:23:01 +0100
| Newsgroups | gmane.comp.db.mdb-tools.devel |
|---|---|
| Message-ID | <[email protected]> |
--===============6207315623111611466== Content-Type: multipart/alternative; boundary="Apple-Mail=_51003FCA-58A6-4426-8B5A-A7343469FA29" --Apple-Mail=_51003FCA-58A6-4426-8B5A-A7343469FA29 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii MSysObjects just tells you the name, type, etc. of the table. You can = ignore it if you just want to read the data.=20 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 =3D 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 = <[email protected]> wrote: >=20 > Hello again :) >=20 > I'm moving forward with my go library and I have arrived at the point = where I need to read the records from the=20 > data pages. >=20 > =46rom what I understood by reading the source code of libmdb, all the = secrets are contained in the MSysObjects table. >=20 > Is there a good reference or description of the MSysObjects table and = object ? What is the basic approach ? >=20 >=20 > Regards > Yannick Heinrich >=20 >=20 >=20 > 2015-12-14 13:34 GMT+01:00 Yannick Heinrich = <[email protected] <mailto:[email protected]>>: > Hello, >=20 > I'm currently trying to create a small Go tool that could deal with = mdb files. >=20 > 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. >=20 > I don't really understand the definition of tdef_pg in the data page = section. >=20 > Is it the index of the page within the whole file ? Is it an offset = relative to the beginning of the file ? >=20 > 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/> >=20 > 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. >=20 > Could someone give me more information about the tdef_pg pointer and = more generally,=20 > how is a data definition page found from the data page header ? >=20 > Yannick >=20 >=20 >=20 >=20 > = --------------------------------------------------------------------------= ---- >=20 > _______________________________________________ > mdbtools-dev mailing list > [email protected] = <mailto:[email protected]> > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev = <https://lists.sourceforge.net/lists/listinfo/mdbtools-dev> >=20 >=20 > = --------------------------------------------------------------------------= ---- > 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=3D267308311&iu=3D/4140______= _________________________________________ > mdbtools-dev mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mdbtools-dev --Apple-Mail=_51003FCA-58A6-4426-8B5A-A7343469FA29 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=us-ascii <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dus-ascii"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D"">MSysObjects just tells you the name, type, etc. of the table. = You can ignore it if you just want to read the data. <div = class=3D""><div class=3D""><br class=3D""></div><div class=3D"">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.</div><div class=3D""><br class=3D""></div><div class=3D"">What = does a data page look like? Well, it has a header that tells you what = table it belongs to (table id =3D index of the tdef page). Then it is = filled with records, starting from the end. The header stores the = offsets of the records.</div><div class=3D""><br class=3D""></div><div = class=3D"">What do records look like?</div><div class=3D"">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.</div><div = class=3D""><br class=3D""></div><div class=3D"">How do you find data = pages for a specific table?</div><div class=3D"">1) Look at the page = usage bitmap for the table (complicated)</div><div class=3D"">2) Just = loop through all pages in the file and look at the table id (easy, fast = enough for all but the largest databases)</div><div class=3D""><br = class=3D""></div><div class=3D"">Hope this helps a little. Reading MDB = files is unfortunately not trivial.</div><div class=3D""><br = class=3D""></div><div class=3D"">Jakob</div><div class=3D""><br = class=3D""></div><div class=3D""><br class=3D""><div><blockquote = type=3D"cite" class=3D""><div class=3D"">On 12 Jan 2016, at 13:16, = Yannick Heinrich <<a href=3D"mailto:[email protected]" = class=3D"">[email protected]</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""><div dir=3D"ltr" = class=3D"">Hello again :)<div class=3D""><br class=3D""></div><div = class=3D"">I'm moving forward with my go library and I have arrived at = the point where I need to read the records from the </div><div = class=3D"">data pages.</div><div class=3D""><br class=3D""></div><div = class=3D"">=46rom what I understood by reading the source code of = libmdb, all the secrets are contained in the MSysObjects = table.</div><div class=3D""><br class=3D""></div><div class=3D"">Is = there a good reference or description of the MSysObjects table and = object ? What is the basic approach ?</div><div class=3D""><br = class=3D""></div><div class=3D""><br class=3D""></div><div = class=3D"">Regards</div><div class=3D"">Yannick Heinrich</div><div = class=3D""><br class=3D""></div><div class=3D""><br = class=3D""></div></div><div class=3D"gmail_extra"><br class=3D""><div = class=3D"gmail_quote">2015-12-14 13:34 GMT+01:00 Yannick Heinrich <span = dir=3D"ltr" class=3D""><<a href=3D"mailto:[email protected]" = target=3D"_blank" class=3D"">[email protected]</a>></span>:<br= class=3D""><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 = .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr" = class=3D""><span style=3D"font-size:12.8px" class=3D"">Hello,</span><div = style=3D"font-size:12.8px" class=3D""><br class=3D""></div><div = style=3D"font-size:12.8px" class=3D"">I'm currently trying to create a = small Go tool that could deal with mdb files.</div><div = style=3D"font-size:12.8px" class=3D""><br class=3D""></div><div = style=3D"font-size:12.8px" class=3D"">I'm currently reading the HACKING = file at <a = href=3D"https://github.com/brianb/mdbtools/blob/master/HACKING" = target=3D"_blank" = class=3D"">https://github.com/brianb/mdbtools/blob/master/HACKING</a> = ;to be able to decode a Jet4 file for now.</div><div = style=3D"font-size:12.8px" class=3D""><br class=3D""></div><div = style=3D"font-size:12.8px" class=3D"">I don't really understand the = definition of tdef_pg in the data page section.</div><div = style=3D"font-size:12.8px" class=3D""><br class=3D""></div><div = style=3D"font-size:12.8px" class=3D"">Is it the index of the page within = the whole file ? Is it an offset relative to the beginning of the file = ?</div><div style=3D"font-size:12.8px" class=3D""><br = class=3D""></div><div style=3D"font-size:12.8px" class=3D"">I fall on = this page speaking about tdef_pg on sourceforge : <a = href=3D"http://sourceforge.net/p/mdbtools/mailman/message/3267842/" = target=3D"_blank" = class=3D"">http://sourceforge.net/p/mdbtools/mailman/message/3267842/</a><= /div><div style=3D"font-size:12.8px" class=3D""><br class=3D""></div><div = style=3D"font-size:12.8px" class=3D"">I created a small program printing = all the headers of the data pages and I did not get the offset = mentionned in this page.</div><div style=3D"font-size:12.8px" = class=3D"">Moreover, on this page, a page_id is mentioned but no trace = in the HACKING file.</div><div style=3D"font-size:12.8px" class=3D""><br = class=3D""></div><div style=3D"font-size:12.8px" class=3D"">Could = someone give me more information about the <span = style=3D"font-size:12.8px" class=3D"">tdef_pg pointer and more = generally, </span></div><div style=3D"font-size:12.8px" = class=3D""><span style=3D"font-size:12.8px" class=3D"">how is a data = definition page found from the data page header ?</span></div><span = class=3D"HOEnZb"><font color=3D"#888888" class=3D""><div = style=3D"font-size:12.8px" class=3D""><span style=3D"font-size:12.8px" = class=3D""><br class=3D""></span></div><div style=3D"font-size:12.8px" = class=3D"">Yannick</div><div style=3D"font-size:12.8px" class=3D""><br = class=3D""></div><div style=3D"font-size:12.8px" class=3D""><span = style=3D"font-size:12.8px" class=3D""><br class=3D""></span></div><div = style=3D"font-size:12.8px" class=3D""><span style=3D"font-size:12.8px" = class=3D""><br class=3D""></span></div></font></span></div> <br = class=3D"">---------------------------------------------------------------= ---------------<br class=3D""> <br class=3D"">_______________________________________________<br = class=3D""> mdbtools-dev mailing list<br class=3D""> <a href=3D"mailto:[email protected]" = class=3D"">[email protected]</a><br class=3D""> <a href=3D"https://lists.sourceforge.net/lists/listinfo/mdbtools-dev" = rel=3D"noreferrer" target=3D"_blank" = class=3D"">https://lists.sourceforge.net/lists/listinfo/mdbtools-dev</a><b= r class=3D""> <br class=3D""></blockquote></div><br class=3D""></div> = --------------------------------------------------------------------------= ----<br class=3D"">Site24x7 APM Insight: Get Deep Visibility into = Application Performance<br class=3D"">APM + Mobile APM + RUM: Monitor 3 = App instances at just $35/Month<br class=3D"">Monitor end-to-end web = transactions and take corrective actions now<br class=3D"">Troubleshoot = faster and improve end-user experience. Signup Now!<br class=3D""><a = href=3D"http://pubads.g.doubleclick.net/gampad/clk?id=3D267308311&iu=3D= /4140_______________________________________________" = class=3D"">http://pubads.g.doubleclick.net/gampad/clk?id=3D267308311&i= u=3D/4140_______________________________________________</a><br = class=3D"">mdbtools-dev mailing list<br = class=3D"">[email protected]<br = class=3D"">https://lists.sourceforge.net/lists/listinfo/mdbtools-dev<br = class=3D""></div></blockquote></div><br = class=3D""></div></div></body></html>= --Apple-Mail=_51003FCA-58A6-4426-8B5A-A7343469FA29-- --===============6207315623111611466== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ 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 --===============6207315623111611466== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ mdbtools-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mdbtools-dev --===============6207315623111611466==--