April 18, 2024, 05:23:35 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


.ini files -vs- DBs... any ideas?

Started by CodeTRUCKER, December 09, 2009, 06:29:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

CodeTRUCKER

I have been messing around with EB for some time and I am now ready to move on to "bigger and better.  I have been vacant from this board (not even lurking a lot), but I have tried the search and still have not come up with the right keywords yet.  SO, please send me a link to the right thread, if it already exists or render some assistance if you can.  Here is my situation...

I am wanting to move to an ability to build record bases, but I do not want to burden the public with having to have Access (not everybody has it), Excel or any other proprietary DB.  I had considered using the free "Addabas" (OpenOffice), but again, that puts an additional necessity on my potential customer base.  I want it nice and simple for them.  No hurdles.  Keep in mind I develop with the blind and lame in mind.  I also like to make my apps accessible to Mac and Linux via emulators, so simple is best.  This has led me to just using a *.ini to store data, but I don't understand how to read/write "text" in EB yet.  I used to do this with VB5 pretty smooth, so I am confident there is a way to do this in EB too.

<<1>>  Please direct me to what I need to "read" a text file.  I will probably want to create a file with an extension of *.ebt or something like that just to keep the data relatively safe from corruption.

<<2>>  Please comment if you know about any other alternatives as a DB or other method of "reading/writing" data.

Frankly, I have been giving Delphi another good look due to its elegant way of setting up and handling data apps.  Any comments from former/present Delphi developers (or others) about this (or other language possibilities) should be via PM only, please!  Paul has created a great tool/community here and I have no interest in proselytizing anyone from IonicWind, but I do need the help.

Your feedback would be most appreciated!
Calvin
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

LarryMc

December 09, 2009, 07:11:57 PM #1 Last Edit: December 09, 2009, 07:13:52 PM by Larry McCaughn
The help file in the General Programming/File Operations pretty much covers it if you want simple and straight forward.

You can use create/manipulate Access files without MS Access with Eb.  I do it all the time.

How you go about it is pretty much dictated by the nature of your data and how you need to manipulate.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Ionic Wind Support Team

If they have any version of Internet Explorer released since 2005 then they have ODBC installed already and don't need Access.  Or any version of Microsoft Office, or Windows Vista/7, etc.

In fact the only time I have ever had to manually install the Microsoft Desktop Database Drivers (either as ODBC or MDAC) was with Windows 98.  I used to maintain a link to the Microsoft download of MDAC but it hasn't been an issue in so long that the amount of Windows machines that don't have the Access ODBC driver installed is probably 1-2%

Paul.
Ionic Wind Support Team

billhsln

You might want to take a look at:  http://www.ionicwind.com/forums/index.php/topic,1390.0.html

It is a Windows example, but does read and write files.

Bill
When all else fails, get a bigger hammer.

acelli

I agree with what Larry said...  you don't need "Access" the application to read, write or even create db.mdb files.  If SQL is what you want/need you might also consider SQLite http://sqlite.org/.  I find SQLite as easy to use as Access and you can create triggers.  I also use EB to connect to enterprise db's like Oracle and MS SQL-Server using ODBC.  Finally, if text files are your choice EB is very easy to use with as many features as any other language.   

Alan

Bruce Peaslee

Reading/Writing text files for a database is easy. Just create your own record as a Type. The user manual shows how.

I prefer using Access databases. It's true that it works almost everywhere. I have Access on my machine which makes creating the database and providing test data very simple.

Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

CodeTRUCKER

Quote from: Larry McCaughn on December 09, 2009, 07:11:57 PM
The help file in the General Programming/File Operations pretty much covers it if you want simple and straight forward.

You can use create/manipulate Access files without MS Access with Eb.  I do it all the time.

How you go about it is pretty much dictated by the nature of your data and how you need to manipulate.

Larry

Thanks Larry!  I have been working through this without success.  I will be creating a mock form and attempting to make this work.  If I keep having errors, I will post back.
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

CodeTRUCKER

Quote from: Paul Turley on December 09, 2009, 08:20:23 PM
If they have any version of Internet Explorer released since 2005 then they have ODBC installed already and don't need Access.  Or any version of Microsoft Office, or Windows Vista/7, etc.

In fact the only time I have ever had to manually install the Microsoft Desktop Database Drivers (either as ODBC or MDAC) was with Windows 98.  I used to maintain a link to the Microsoft download of MDAC but it hasn't been an issue in so long that the amount of Windows machines that don't have the Access ODBC driver installed is probably 1-2%

Paul.

Thanks Paul!  Maybe I am in the "wrong room?"  I have not been in real deep on cross-platform, this seems to be Microsoft-centric.  Is it, or does this work well on O/S emulators?
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

CodeTRUCKER

Quote from: billhsln on December 09, 2009, 08:59:44 PM
You might want to take a look at:  http://www.ionicwind.com/forums/index.php/topic,1390.0.html

It is a Windows example, but does read and write files.

Bill

Thanks Bill!  I have taken a look at this and will work through it in tandem with Larry's suggestion.  So far, I am not getting anything but errors, but I will report back per my note to Larry.
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

CodeTRUCKER

Quote from: acelli on December 09, 2009, 10:56:51 PM
I agree with what Larry said...  you don't need "Access" the application to read, write or even create db.mdb files.  If SQL is what you want/need you might also consider SQLite http://sqlite.org/.  I find SQLite as easy to use as Access and you can create triggers.  I also use EB to connect to enterprise db's like Oracle and MS SQL-Server using ODBC.  Finally, if text files are your choice EB is very easy to use with as many features as any other language.   

Alan


Hi Alan, thanks for chiming in!  I worked with DB2 many moons ago so SQL (never worked with it yet) may be what I am after if the *.ini files don't work out.  A lot of experimentation left to do before I make the call.  Thanks for the link to SQLite.
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

CodeTRUCKER

Quote from: peaslee on December 10, 2009, 11:43:06 AM
Reading/Writing text files for a database is easy. Just create your own record as a Type. The user manual shows how.

I prefer using Access databases. It's true that it works almost everywhere. I have Access on my machine which makes creating the database and providing test data very simple.



Thanks, Bruce!  Just to make sure we are on the same page, the "reading" I am talking about would be similar to the old VB5 "mid" and "trim" commands to parse (that's the word I have been trying to remember!) a text file where each line is a different record.  "Writing" would be the opposite, "print' each line as a separate rec.
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

LarryMc

Quote from: CodeTRUCKER on December 10, 2009, 05:12:38 PM
Thanks, Bruce!  Just to make sure we are on the same page, the "reading" I am talking about would be similar to the old VB5 "mid" and "trim" commands to parse (that's the word I have been trying to remember!) a text file where each line is a different record.  "Writing" would be the opposite, "print' each line as a separate rec.
So now you are giving us something to work with.
Your "data" is/are lines in a text file.

The first issue is how long is the maximun line length.
If it's over 255 character's you' have to read the strin into an ISTRING variable instead of a STRING variable.

The next question is what do you use to delimit between  text fields?

use the INSTR function to find the delimiter
use the INSTR function to find the next delimiter
use the MID$ function to extract the desired field

sorta along those lines

Larry


LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

If maybe you posted  couple of lines then someone could offer better opinions on which way to go.

Alos, how many lines are we talking about?

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

CodeTRUCKER

Quote from: Larry McCaughn on December 10, 2009, 07:08:52 PM
If maybe you posted  couple of lines then someone could offer better opinions on which way to go.

Alos, how many lines are we talking about?

Larry

In reference to your previous post... BINGO!  :)  FYI - I tried very hard to make the right picture in the minds, but I didn't get it done right.  :(  Well, like my old coach used to say, "That's character bulidin' stuff!"


In reference to this post... as many lines as are needed (think: CSV).  Let me try this...


  • *.ini (txt) file = database
  • Line = record
  • Various sets of delimited data positions in the line = data fields in a record

I know you understand what I am saying.  My whole purpose is to try and keep my efforts as cross-platform (simple) as I can.  This is why I want to use a "text" file as my database.  Another ancillary reason is I maintain that all user data is the user's data.  I do not want to lock it up in some proprietary db.  I know this is very anti-Microsoftish, but after losing a bunch of emails and address books to .pst and .pdb files, I just don't have the heart to make other (perhaps, less techy) people go through what I did to get my data

I hope that helps.
Calvin
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

LarryMc

okay, CSV it is.

With EB's datbase functions you can specify CSV files and be able to use all the SQL features to find, add, alter data.

So you need to be reading the Database section of the help file instead of the file operations section.

By going that route you pickup indexing/sorting along with all the search techniques.
It will also be a lot faster in it's response and a lot simple to program once you get it setup.

If you agree that this is the route you want to take I will move this topic to the database section.

Larry

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

CodeTRUCKER

Paul, Larry, Bill, Alan, Bruce, Mike, ??,

A quick note to say "Thanks," for the help so far, but it is overwhelming at present.  Please don't construe my absence as indifference.  I am only sorting through what you helpful folks have lavished on me!  I will be back bothering asking you all for assistance soon enough, you'll see.  ;)

I have done a lot of reading of historical threads and I have not been able to locate the "Dialog Editor (a Visual IDE?)" and the "Designer."

@Larry - I really like your Button and Chart Designers!  They look really nice!  I will acquire them when I get some spare change.  My wife asked what I might like for Christmas and I will certainly put those on her list!

See you soon!
Calvin
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

mrainey

Emergence Designer - http://www.ionicwind.com/forums/index.php/board,45.0.html

The Dialog Editor is part of the IDE - second icon from the left on the toolbar.
Software For Metalworking
http://closetolerancesoftware.com

LarryMc

LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

CodeTRUCKER

Quote from: mrainey on December 11, 2009, 05:47:41 PM
Emergence Designer - http://www.ionicwind.com/forums/index.php/board,45.0.html

The Dialog Editor is part of the IDE - second icon from the left on the toolbar.

Hi Mike - Good to "see" you again and thanks for the link!
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

CodeTRUCKER

Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

mrainey

Software For Metalworking
http://closetolerancesoftware.com

LarryMc

Quote from: CodeTRUCKER on December 11, 2009, 06:17:25 PM
Quote from: Larry McCaughn on December 11, 2009, 06:00:50 PM
And here is where you can purchase the beta of the designer and the source code.

http://www.ionicwind.com/forums/index.php/topic,3156.msg25789.html#msg25789

Larry

I'm looking it over.  Do you use it?

It is a preliminary beta.
As of yet it does not generate the code.
However it does have all the code that would handle the dragging/adding of buttons that works.
And it is written in EB itself.
My thought was that you could use it to study and then adapt all the stuff you really need into your scheme.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

CodeTRUCKER

Quote
...
My thought was that you could use it to study and then adapt all the stuff you really need into your scheme.

Larry

Mindreader!  :)

Any screen shots?
Calvin Waterbury


Truth, unlike opinion, tradition, etc. will always be able to stand on its own.  Truth is not a static, but a living entity and will perpetually impart life; therefore, any "truth" that does not or can not impart life can not be Truth.

LarryMc

Attached is a very crude swf showing buttons being dragged to a form and moved and resized.

The software I used to make the swf is new to me so, like I said, it's crude.
It's my fault and not the designer's.

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library