database coding (XML, CSV, TXT) - newbie needs help...

Posted on 2003-03-03
Medium Priority
Last Modified: 2013-11-23
hi experts,

i am right into coding a program, which i need to store some data in a database. since its only a little amount i dont want to use the BDE. i already did some experiments with a component for comma-separatet-text database from torry as well as using tclientdataset and its xml features. the huge problem i have is, that both solutions only provide for a pretty flat style database (like a phonebook). the data i have is laid out in the following way, and i want to store it in a single file (XML? or INI?)

system (one string)
coordinateX,coordinateY (two integers)
faction (one string)
connectsto (one ore more strings (would be values from sytem^) !)

station (one string)
system (from system ^)
coordinateX,coordinateY (two integers, other then the ones in system)
belongs (one string)
connectsto (one or more strings from station^)

its pretty hard for me to figure out, because im just beginning db-programming. i need a real good solution for this. the whole db has to be stored in only one file and i dont want additional dll's or stuff to ship with the executable.

i hope i made myself clear enough to undestand ?
Much thanks in advance,

Question by:g_BonE
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4

Expert Comment

ID: 8059321
If your data is that simple, you can probably stream out the XML to a text file yourself.
  <SYSTEM>one string
    <X-AXIS>one integer </X-AXIS>
    <Y-AXIS>one integer </Y-AXIS>
  <FACTION>one string

Another solution is Interbase, which is open source and/or Access which is not.  Also, the MSDE is an option.  What version of Delphi are you using?  Delphi 5 and higher supports ADO for sure, not sure about older versions.


Expert Comment

ID: 8059327
I forgot to say that by using ADO you can completely bypass the BDE.


Author Comment

ID: 8060502
im using d6 pro. i just had a look into a few freeware dbf components. the problem is that i eventually need to add pictures to this database too. i will post a more accurate structure of the databas as i build it up, hope you guys can help ?!

Thanks for the first few comments ARW.

oh.. gonna look into ADO. are there additional files to the compiled exe if i use ADO ?
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 8062741
okay, i got a first prototype layout ready. bad thing is, that it is not as easy as i thought first. hope you can help me ?

*first part:

system-name - string (42 entries)
coordX,coordY - both integer
faction - string (8 entries)
connects - one ore more of the system-name's
one picture (galaxy-map)

*second part (would have none or one or more sets):
 sub-level of system-name

station-count - integer (# of station-name's)
station-name - string (0-? entries)
coordX,ccordY - both integer
belongs - string (approx. 30 entries)
connects - one or more of the station-name's
pic - picture (system-map)
{trades - 0-? of the ships/weapons/other below

*third part (would have one or more sets):    everything in {} is optional
 sub level of station-name                    for now, but will be included.

ships -  string (approx. 30 entries, needs to have name,details, price, etc.)
weapons - string (approx. 80 entries, needs to have name,details, price, etc.)
other - string (approx. 100 entries, needs to have name,details, price, etc.)}

system-name -> station-name's->trades

the coordx,coordy are there to draw a point at the canvas of a timage (???)
connects would be used to draw lines between systems and stations.

Accepted Solution

ARW earned 150 total points
ID: 8073038
I am not sure I understand teh hierarchy of your data.  When you say first part, is that the first data packet?

Are there master/detail relationships in each part?


each system entry has an x and a y entry?


Author Comment

ID: 8074929
uhm... i went on and have it working pretty well now using a tdbf data set. since im pretty new to db-coding i really had some hard days trying to nut this one out. thanks for the help anyway.

Author Comment

ID: 8074937
oh and... here ya go with the points ;)

Expert Comment

ID: 8077310


If you are using ADO in Delphi 5.0 there is a patch you should get from Borland.  You have to apply the first service pack and then you can apply this mini-Ado patch.

Good Luck


Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month8 days, 10 hours left to enroll

764 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