Logo F2FInterview

Delphi Interview Questions

Q   |   QA

Delphi Desktop does not directly support any back-ends except for Local InterBase, and of course the BDE (Borland Database Engine) itself. Delphi Client/Server directly supports Oracle, Sybase, Informix, and InterBase. In both cases, you can use third-party ODBC drivers to connect to any system you want. 

Yes, generally. I have not encountered any ODBC drivers that don't work with Delphi, but on the other hand, I haven't tried any really exotic ones. 

There is no way to do this within the Delphi VCL. Seems like a pretty serious omission to me. However, it is possible to do it by talking directly to the Borland Database Engine through the interface provided by the DBIPROCS and DBITYPES units. You call DbiDoRestructure, but set all the "number of" variables to zero, which makes it leave the existing values intact. I have code to do this, but it's a bit too long to included here. E-mail graham (at) mhn.org if you want it. 

It is sometimes desirable to write code that deals with databases but is not associated with any particular form or user-interface details. To do this, you declare variables of type TDatabase, TTable and/or TQuery, and set their properties in code just as you would in the design environment. Make sure that you include the DB and DBTables units in your uses statement, or you will get "unknown identifier" errors during compilation. 

If you look at the declaration, the Sender object is of type TObject, which is the class from which (almost) all other objects are derived. You're probably trying to access a property that isn't defined in TObject, like Text or Caption or something. For this reason, "Sender.Text" will fail, but if (for example) you know that the sender is of type TEdit, then you could use "(Sender As TEdit).Text". If you aren't certain that the Sender object will always be the same type, you can check it with "if (Sender is TEdit) then < blah> ;".

In order to link this F2FInterview's page as Reference on your website or Blog, click on below text area and pres (CTRL-C) to copy the code in clipboard or right click then copy the following lines after that paste into your website or Blog.

Get Reference Link To This Page: (copy below code by (CTRL-C) and paste into your website or Blog)
HTML Rendering of above code: