Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > DB Tools

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-14-2014, 03:40 PM
larshgf larshgf is offline
Senior Member
 
Join Date: Jan 2001
Posts: 237
Default How to create a simple database in Delphi XE2?

Hope this is the right forum for a Database question.

I use Delphi XE2 for some hobby programming. Its a long time since I last did some database programming. I remember in the Delphi 5 days when I started with using a wizard to build a database with tables etc and then on my form just put TTable and TDataSource and some Datacontrols. Then I was driving with a simple but ok database.

That is what I am looking for right now - but a lot of Things have changed. In the Data Access page of the Component Palette I do not find a TTable componenet any more.

I then made a primitive databse out of strings in a listbox with each string as a record with fields seperated by '|'. I made a filter function but it lasts 4-5 seconds to filter the 3000 records I have in my database.

I Wonder if somebody had an idea for me to make this better. It could be the nowadays way of implementing a real database in Delphi XE2 (a link to a tutorial would be much apreciated!) or it could be another way to handle this problem (FileStream? - Records? - StringList? etc). It is important though, that one of the fields must be unicode as the database is handling some greek Words.

Hope someone out there in the World can give me some proposals for solving my problem here

Best Regards
Lars - DK
Reply With Quote
  #2  
Old 09-14-2014, 05:02 PM
kolbasz kolbasz is offline
Senior Member
 
Join Date: Nov 2013
Posts: 841
Default

First you have to choose a database server. The two most popular among delphi programmers are mysql and firebird. Although I prefer firebird better, mysql is more common. Both of them has an embedded version(meaning: you don't have to install a server, just copy some dll's in the same directory as your exe and you're ready to go). Both of them are relational databases with tables, triggers, stored procedures, indexes, domains etc, with the possibility to add user specific privileges.
Because of the popularity, more documentation and probably more examples, I recommend mysql.

To create, manage a mysql database on your local computer, download EMS SQL Manager, the freeware edition, is more then enough for a hobbyist:
http://www.sqlmanager.net/en/product...nager/download
Please note: to be able to use this tool, you have to install a mysql server. If you are familiar with XAMP/WINLAMP then feel free to create/edit the database with phpMyadmin.

To access the database from delphi, I recommend a free component(Zeoslib):
http://zeoslib.sourceforge.net/
http://sourceforge.net/projects/zeos...atest/download
After install, you will find on the component palette a database connection, transaction + querys/tables etc, the regular database tools.
If you have any questions feel free to ask.

regards,
kolbasz
Reply With Quote
  #3  
Old 09-14-2014, 06:36 PM
larshgf larshgf is offline
Senior Member
 
Join Date: Jan 2001
Posts: 237
Default

Thank you for your answer,
I would like very much to be clear of thirdparty components.
I see in the samples (....Samples\Delphi\VCL\Frames) there is a demo about frames containing some database stuff with clientDataset and DataSource. There does not seem to be any thirdparty components or any dll's involved here- Will this be an option in your opinion?

BR Lars
Reply With Quote
  #4  
Old 09-14-2014, 09:04 PM
kolbasz kolbasz is offline
Senior Member
 
Join Date: Nov 2013
Posts: 841
Default

Quote:
Thank you for your answer,
I would like very much to be clear of thirdparty components.
I see in the samples (....Samples\Delphi\VCL\Frames) there is a demo about frames containing some database stuff with clientDataset and DataSource. There does not seem to be any thirdparty components or any dll's involved here- Will this be an option in your opinion?

BR Lars
Well, if you decide to go with "native components" like ClientDataset and DataSource, your will encounter at some point an SQLConnection with a Driver properties, where you can choose a database server...
Reply With Quote
  #5  
Old 09-15-2014, 03:25 AM
GeoWink GeoWink is offline
Senior Member
 
Join Date: Jan 2001
Posts: 885
Default

Check out Absolute database. Very easy to use, straightforward, need no extra dlls or anything. Can use free and cost is very reasonable for commercial use. I would try it. See http://www.componentace.com/

George
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:40 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.