Solved

XML database in disk file

Posted on 2004-03-22
3
250 Views
Last Modified: 2010-05-18
Hi
i proposed to the client that we should not use the database like Access for out project. As in our application we have only one table i proposed to use a XML file.

Application will be developed in VB6.

Now what i want is that i want to use the DOM.  Problem is DOM reads the whole file in memory.  I do not want to read the whole XML file in memory instead i give a XPATH Query and DOM loads only selected nodes from disk to memory. Then i want to do operation like add a new record, modify and delete record and still i do not want to load the entire XML file in memory.

Here is what should be the XML database file format

<Database>
<Table Name = " ">
     <Record ID="1">
             <field1 value="">
             <field2 value="">
             <field3 value="">
      </Record>

     <Record ID="2">
             <field1 value="">
             <field2 value="">
             <field3 value="">
      </Record>

     <Record ID="3">                    i want only one record
             <field1 value="">            to be load in DOM
             <field2 value="">
             <field3 value="">            also i want to modify
      </Record>                             this record in the file

                                                  I ALso want to delete
                                                  this record from XML
                                                                                    ----------and so on-------------
</Table>

-----More tables in future here----------------
</Database>

I think file will grow 200K each month by added new records. So loading the entire file in memory will not be acceptable solution after say 1 year.

I will also conside if there is a samll XML database available on the internet. PLease suggest free tool

Thanks
Shahzad
0
Comment
Question by:shahzad73
3 Comments
 
LVL 49

Accepted Solution

by:
DanRollins earned 125 total points
ID: 10653990
I don't think you can use XPATH to pull just specific nodes without loading the XML into memory.

I could easily be wrong, but every example I can find starts with a Load command.  Eg:

   http://msdn.microsoft.com/library/en-us/xmlsdk/htm/dom_hdi_vb_2w8j.asp

One possibility would be to write a pre-processor that scanned through the file to locate specific items, then generate a new subset XML file and load it.

-- Dan
0
 
LVL 1

Author Comment

by:shahzad73
ID: 10656213
thanks for the advise...

lets see some body comes up with some other idea.


Shahzad
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
This article will show, step by step, how to integrate R code into a R Sweave document
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question