?
Solved

What's the SIMPLEST database application method?

Posted on 2004-11-14
9
Medium Priority
?
354 Views
Last Modified: 2010-04-05
This is a bit of a long question; I hope I can find a patient expert! But I want to make my problem as clear as possible ...
 
I am writing a simple database application in Delphi, running on a Microsoft Access database. The handling of data and the front face design are going wonderfully, and those tasks are well within my capabilities; what I have trouble with is setting up the various technical connections needed to make the things work in the first place.

My initial question on this app (about unwanted Login prompts) showed I wasn't really aware of how the blessed components connected in the first place:

http://www.experts-exchange.com/Programming/Programming_Languages/Delphi/Q_21009092.html

... and now since having that question answered, I have happily written most of the app. But now when I release it to a few beta-test people they get a message saying "An error occured while attempting to initialze the Borland Database Engine (error$2108)". I was unaware I was actually USING the BDE (my ignorance of this kind of technical understructure would fill books) and given some of the problems I understand it causes, I would rather NOT use the BDE.

However I have written the entire app based around a TDatabase, and a TQuery ... only it turns out the TQuery is descended from TBDEDataset, which drags the whole BDE thing in. I am only using SQL access to the database anyway.

My question is basically: is there a simple database handling system in Delphi where I can just drop something on the screen and have a Query run SQL through it? I neither want nor need to get into all this technical stuff about BDE and ODBC ... it just seems to me that someone at some stage must have thought "hey, why don't we just write a MicrosoftAccessDataHandlerObject and be done with it?" ... does such a thing exist? If not, what alternatives are there? What is the SIMPLEST way of handling a database in an application?

Parameters: the app has a database onboard but it does NOT connect to the web, nor is it even networked beyond being accessible from different computers (that is, only one computer can be signed in to it at any one time) ... I am using Delphi 7 ... I have Access 2002 ... now that I have written so much, the solution MUST tie in to an object similar to a TQuery (i.e. one that has an SQL property that I can fill and then execute it).

Given that there could be varying points of view on this one, I have allotted a reasonable amount of points so I can subdivide if necessary. I'll close it in 80-odd hours.

0
Comment
Question by:MartinC
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 1

Assisted Solution

by:pr_wainwright
pr_wainwright earned 80 total points
ID: 12579335
Try TxQuery

http://www.sigmap.com/MainFrame.htm

Topaz is also good  from www.softsci.com but it uses DBase tables.

Neither require the BDE.

Regards
Paul.
0
 
LVL 14

Accepted Solution

by:
DragonSlayer earned 720 total points
ID: 12579402
Use all the ADO components instead... TADOQuery, TADOConnection, etc. That way, you will be 'free' from BDE.
0
 
LVL 17

Assisted Solution

by:Wim ten Brink
Wim ten Brink earned 160 total points
ID: 12580493
ADO! ADO! ADO! ADO! ADO! ADO! ADO! ADO! ADO! ADO! ADO! ADO!

Repeat
  Write('ADO! ');
until Forever;

DragonSlayer is just right! If you want to keep it simple, just use ADO. It works perfectly with the MS databases like Access and SQL Server and lots of other databases do support ADO too these days.

The simplest way of handling a database in Delphi is a very easy one. Use a "File of RecordType" to store your data in. This has worked for about 20 to 30 years without much problems. The only drawback is that you yourself have to write all the code to search, modify, delete and insert records. But hey, because you need to do so much work to get it working, it is very impopular these days.

Ever since Borland created the TDataset as base class for all tables and queries, there have been a lot of people who created their own TDataset-based component set. And in site that I lost a long time ago again I even saw how it would be possible to create your own TDataset component arround your own "File of recordtype" file. Pretty neat. At the moment I use something called FlashFiler, but this is because this database is set up to be client/server based. For personal use I prefer to stich to ADO, combined with SQL Server or Access.

There are just too many different options here and everyone has his or her own favorite. But if you continue to use Access for data storage, ADO is just the ideal solution. So blame Dragonslayer for providing the right answer. ;-)
0
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.

 
LVL 14

Expert Comment

by:DragonSlayer
ID: 12581056
*ouch* I got blamed again... :-p
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12589181
Of course I blame you. You're more than 50.000 points ahead of me in the top-15... :-P
But I'm gaining on you... :-)
0
 

Author Comment

by:MartinC
ID: 12589406
OK, I am using TADOQuery and TADOConnection and to my astonishment it appears to be working! So when I compile this thing into an exe can I just send out the exe and the database and it'll work?
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 12590212
> You're more than 50.000 points ahead of me
But hey, I've been slacking this year, and look, you are 47k points ahead of me in this year's results :-p

MartinC:
Yea, Windows machine come with the drivers ready for Microsoft stuff (access, vb runtimes, c++ runtimes)... no wonder they can keep dominating, lol ;-)
0
 

Author Comment

by:MartinC
ID: 12590277
OK, I am gonna close this one off now, as the ADO stuff seems to be working.

Paul: thx re TxQuery. I checked it out and it looked OK but I'll only use a third-party component if I can't find an onboard one to do the job. 20 points.

Alex: Thanks for the background on ADO. 40 points.

DragonSlayer: Great solution. 180 points.

And as for Microsoft dominating, funny, their share price plummeted 9% overnight ... someone knows someone we don't!

MartinC
0
 
LVL 17

Expert Comment

by:Wim ten Brink
ID: 12592912
> But hey, I've been slacking this year, and look, you are 47k points ahead of me in this year's results
Yep. I'm halfway there already... Still need over 50k more. You might have been slacking this year but I've been slacking the years before...
Still, it's nice to be 4th this year... But I sometimes wonder how others seem to have enough time to answer all Q's. I need to avoid real work to put answers here. :-)
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

862 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