Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delphi and Databases - where to start

Status
Not open for further replies.

topcat01

Programmer
Jul 10, 2003
83
GB
Hi,

I want learn to write database applications - anybody on the list have any recommendations were I should start.

I have been told read into using ADO and MS Access... I am working with Delphi Pro 6. Is it worth upgrading to latest Delphi before starting? Thanks in advance.
 
I use Delphi 6 enterprise. I've checked out Delphi 2006, and wasn't impressed. There may be more options, a couple of new reserved words you can use, but nothing compelling for what I need.

So long as you have 3 three service packs, you shouldn't have any problems using D6.

I've found ADO and Access databases to be the easiest way to get started.

To get started, drop a TADOConnection component and a TADOTable on a form. Click the TADOConnection.ConnectionString and the little edit button, click Build, choose Microsoft Jet 4.0 OLE DB Driver, then click Next, then navigate to your Access database. You can modify any of the other settings, but that's all you need for the moment.

Change TADOConnection.LoginPrompt to False, and TADOConnection.Connected to True. You're now connected to your database. If your database requires a username and password, then don't change LoginPrompt.

Now link the TADOTable to your connection. This will provide a link to a specific table in your access database. Change TADOTable.Connection to ADOConnection1, Change TADOTable.Tablename to the table of your choice. Change TADOTable.Active to True. Your table is now active.

To use some of the DB-aware controls, drop a TDataSource and a TDBGrid on the form. Change TDataSource.Dataset to ADOTable1, change TDBGrid.DataSource to DataSource1. Your DBGrid can now see all the records in your table.

That should be enough to get you started. Have a play, post back with more questions!
 
Try this tutorial from delphi.about.com, it's designed for beginners:
Incidentally, this was the first entry in the google results relating to the search terms: delphi database.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Thanks Griffyn, got db up and running, i'm glad your recommending D6, I can't face re-installing to a newer ver.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top