[DUG] SQL Issues

Karl Reynolds kreynolds at chocfishsoft.co.nz
Thu Jun 18 11:32:04 NZST 2015


I can't spare that amount of time, but try commenting out the bodies of all
events on the dataset and datasource (ondatachange etc) and the bodies of
events on any data-aware controls (that are linked to the datasets in
question). Then if the basics work, uncomment step by step. I'm guessing
there's something around that's posting your dataset when you don't want it
to and something else that's pushing a change when it shouldn't.

Having said that, I only use TSQLQuery and TClientDataSet (which I don't
use MasterSource on), so if you're using some master-detail dataset setup
or ADO etc. things will be different.

As far as debugging goes,
- put on debugging and range checking and overflow checking in the
compiler. If you're still learning you can leave debug dcus off, which will
simplify your call stack.
- put breakpoints in your code
- F7 to step into a function, Shift F7 to continue to the next source line
(like when the CPU window shows), Shift F8 to continue back to the function
that called it
- if you're really struggling with not being able to evaluate variables,
turn optimization off
- The Call Stack is your friend
- When the Call Stack is not your friend, bring up the Threads window to
switch threads to the right one. Then the Call Stack is your friend again.

Cheers,
Carl

On Wed, Jun 17, 2015 at 11:13 PM, Marshland Engineering <
marshland at marshland.co.nz> wrote:

> I have got to the end of my tether. Table not in insert mode. I have quite
> a
> few programs that use single tables in forms with editing and all is well.
>
> This new form has editing in 2 tables and here is where the trouble starts.
> Even if I don't enter any data and just close the form, I get not in edit
> mode. I've take off all the SQL relationships to try and find the issue
> but I
> can't pinpoint where it lies. If I leave the tables in edit mode, all is
> ok if
> I post and them immediately put them back into edit mode, I get a crash.
>
> Is there anyone in ChCh who is willing to spare a hour or 2 to give me a
> hand.
> Help with how to debug something like this would be very handy.
>
> Cheers Wallace 3237449
>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with
> Subject: unsubscribe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20150618/847b549d/attachment.html 


More information about the Delphi mailing list