PDA

View Full Version : text databases, tutorial?


Morgoth
03-12-2003, 06:19 AM
Hello,

I am looking for some good tutorials on using a text file as a database so I can add text to it, remove text from it, and display text from it in ASC and DESC order.

Either using FSO or maybe a method I do not know about.

Thank you very much.

raf
03-12-2003, 01:19 PM
I'd go for XML.

Here a nice short tutorial i've went through recently.
http://www.3gwt.net/dje/xml_notes.htm
Didn't realy use it until now, but if i ever need to do some serious work with a textfile, i'm gonna take this approach.

(besides, XML and the DSO realy has potential for some recordset-paging or delivering data to other application or as a middletier and stuff so it definitely is on my "to do" list).

Morgoth
03-12-2003, 08:22 PM
Originally posted by raf
(besides, XML and the DSO realy has potential for some recordset-paging or delivering data to other application or as a middletier and stuff so it definitely is on my "to do" list).

DSO?
You mean FSO?

I never thought of using XML, I didn't really think about it.

I don't know though, becuase there really isn't a reason to use it. All I am storing is 50 lines of text about 60-100 charaters long and so all I need is some sort of FSO tutorial on how to do it fast and efficient, but I want to use something other then FSO if at all possible.

Thanks anyways raf!

whammy
03-13-2003, 12:46 AM
Well for either FSO OR XML, I'd check out http://www.w3schools.com - of course!

I can do almost anything in FSO, lol (although it can be slow with really large files - the reason I use FSO mostly is because we receive plain .txt files from our clients, usually), and after reading those tutorials, you can do almost anything using FSO or XML. ;)

Morgoth
03-13-2003, 01:50 AM
Thank you whammy.

raf
03-13-2003, 08:27 AM
DSO = Data Source Object. Also known (not-nerds-only) as Data Islands.

What it is ? It's actualy sort of an XML file (with tags and all) inside an html page. So you can best think of it as a structured textfile/datacollection inside an html page, that can be linked to, for instance, a table.

This way, you can dynamically buid the table clientsided. You can do the tradition paging stuff for instance, but include a "shox x records" textfield, orderfield, filter etc.
This way, the client can filter, sort, page the recordset without connecting to the server.

This DSO can also be a separate file (server or clientsided)

You can build it by using asp (just build the xml code like you build regular html)

One problem: only works with IE 5 or higher.

Morgoth
03-13-2003, 08:49 AM
Well, the thing is, I have discovered that this project only deals will keeping exactly 50 or less lines of text about 60 to 100 Charaters in size, and One a new line of text is added, the last line of text is removed.

Or probibly cause it would take less code:

A new line is added to the bottom which forced the first line of code to be removed.

And that only happens in there is 50 lines of text in there, if there isn't, then a new line of text is added, and the file is closed.

It's very basic, but that's because I don't need to view the lines of text in these files, only disply them if requested them to be.

And I will have MANY text file databases like this. So it needs to be very simple, fast, and safe.

No index numbers, no need to look inside of the middle at all, only display the lines of code (descending if the second idea is used)

When I am done this, I might make it public (90% chance I will) and you will all see something I made that anyone else can make, but I did it to be friendly.
Mostly for ASP support lacked people.

Eskimo
03-13-2003, 09:58 PM
For a quick little chat room, I think FSO would work fine.

However, XML is great for small flat file databases where simplicity is the goal.

I'm working on running several RSS (Rich Site Summary) feeds to my front page. It should be fairly easy to distribute and include news aggregator when finished.


Just for kicks, I would suggest you read the XML tutorial at w3cScools. If for no other reason, just because its cool.

Morgoth
03-13-2003, 10:32 PM
Originally posted by Eskimo
For a quick little chat room, I think FSO would work fine.

Well, it's a comment panel, not a chat room.. chat rooms need real time refresh rates, and I'm not doing that over the web. Kinda like a shout box if you have ever seen one...

This is why I don't really see a reason to use any XML database.

Eskimo
03-13-2003, 10:54 PM
works for me, sounds like it will be interesting to see. Good luck!

Morgoth
03-14-2003, 01:22 AM
I am making it for kicks, and I want to see how people like it.

It wont ladt forever, and if it does, I can just move it over to brinkster or something.

I want to make it simple, easy, and fast.

I got the IDEA from 8op.com which is no longer up, so I can't copy their idea to the exact, but I am trying to get mine to act like theirs did.

I feel that if I make enough applications and save them I might be able to open one of those ASP help sites like many people do, but better then those newbie: "I can only make a gurestbook, here's the code" sites.

Something like what 8op.com did. If you remember what they did.
But to a lessed extent, I can't offer over hosting to over 100 people. Just little applications and such.

Good times...