Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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
  • 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 ?
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.


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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

581 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