Monday 31 October 2016

Solution to Delphi IDE Freezing Problem

Over the last few years I've been using Delphi XE, and on quite a few occasions the IDE can just freeze for what seems to be no reason. It does not appear to be an issue with small projects, but mainly larger projects and might relate to code insight and how I have it configured. When this problem occurred I use to 'End Task' in task manager, which meant potentially losing some work, but the best solution for when this happens to to find the directory that contains all the 'dcu' files and delete them.

Tuesday 25 October 2016

ADO Stored Procedure Blank Record Issue Fixed

I recently had an issue where I had an ADO stored procedure (TADOStoredProc) that returned a single record from a SQL Server database and the first time it was open it worked fine, however the second time it appeared to return a blank record. After some investigation it appeared the record count was 1, but the recno value was -1.

It appears that when you 'open' the stored procedure it is not guaranteed to position the record pointer on the first record. The solution is to simply call 'first' just after calling 'open'.