Delphi Programming Question:

How do we get access to a database from Delphi?

Tweet Share WhatsApp

Answer:

In general, you have to go to "BDE Config" and define an alias for the database you want to connect to. This allows you to avoid hard-coding a directory path into your application; you just refer to the alias. Then, you create a minimum of three objects on the desktop: A Query or Table object that actually talks to the alias and gets some data; a Data Source object that links between the data and the controls, and at least one data-aware control.

If you've been trying for hours to get this to work, and no matter what you do you just don't see anything happening, try setting the "active" property on the Table or Query to "True." This will open the database. I have seen many people get caught out by this the first time they try it.

Download Delphi PDF Read All 31 Delphi Questions
Previous QuestionNext Question
Can I make calls to Delphi code from C or C++?Does Delphi support the back-end?