June 15, 1998

Parameter Passing

Question: I am writing a program that needs to keep a running total of ID numbers allocated for this reason. The ID numbers are in an auto-increment field. I need a mechanism to keep a count of numbers assigned so that it may be incremented so that the next ID

Max Calculation

Question: How do you select the maximum value of a column in a DBGrid when displayed through a query? (query SQL:select max(CustNo) from customer, and get error message:”the table is read only”) Answer: You have to go to the underlying table itself. You can’t do this through a DBGrid. Remember,

Multiple Inheritance

Question: I read somewhere that Object Pascal, the language used in Delphi, does not support multiple inheritance. Is this true? Answer: Yes, this is true. Object Pascal’s inheritance model follows the Single Inheritance path. Is this a weakness? Perhaps for some, but there have been very few times in any

Error Creating Window

Question: In my Delphi 1.0 application, when I open a form (e.g. ClientForm.Show) I get an error message: “Error creating window.” This error occurs when several forms (nine or ten forms that manage Paradox tables) were previously “showed” then “closed.” An EOutofMemory exception is raised, but doing a MemAvail shows

Access Violation Error

Question: I developed a database using AS400 components. Everything compiled and it was working for awhile. I have not changed anything in the project and now whenever I close the project or exit from it, I get an “Access Violation Error.” I can still run it and everything works fine

Recommended Delphi Books

Question: I am looking for a good introduction book to Delphi. I know Turbo Pascal, but I am still a beginner in the field of OOP and in the field of Delphi. It is quite easy to use and manipulate predefined components with Delphi. But sometimes it is also necessary

Computing Number of the Week

Question: I want to compute the number of the week. Thanks in advance PLM Answer: This is pretty basic stuff. If you want the current week of the month, a simple function will do the trick: function GetWeekOfMonth(Day : Integer) : Integer;begin if (Day >= 1) AND (Day = 8)

Delphi SQL Parameters

Question: Is it possible to use a parameter on the left side of an equality in a WHERE clause? For example: SELECT * FROM TblName WHERE:parm1 = :parm2 When I do this, the results I get suggest that every record passes the equality test, which shouldn’t be the case. Thank

ListBoxes and ItemData

Question: How can I expose the ItemData property of a ListBox to use it for storing longint data that corresponds to each item in the list in Delphi 3.0? I looked in the windows.pas unit and saw that it was a protected property. Is there a way to make it

No more posts to show