Subject | RE: [IBO] Problem again with OnDataChange |
---|---|
Author | Kevin Stanton |
Post date | 2002-01-12T01:22:44Z |
Hi Geoff,
Thanks for the reply.
I could show you how two programs doing exactly the same function, behave
differently.
I have my directories structured as such:
s:\development\Delphi 5 Apps\Lumber CS
and
s:\development\Delphi 6 Apps\Lumber CS
I have different .exes in both directories based on that version of Delphi
and IBO.
Here is the combo: D5 uses IBO 3.6.Cf; D6 uses IBO 4.2.Fn
When I converted my app, I simply copied the s:\development\Delphi 5
Apps\Lumber CS to the D6 directory and recompiled (with some minor changes).
I also have two shortcuts on my desktop point to each .exe.
I have just verfied the code in both D5 and D6 and the OnDataChange events
are identical.
I have also just tried added a new record in both D5 and D6 versions.
In D5, all the assignments come thru. In D6 they do not.
I have just gone into debug mode in D5, when I insert a record, and change
the customer via a TIB_LookupCombo, the OnDataChange event fires with good
data - Field.FieldName does = 'CUSTNO'.
I have just gone into debug mode in D6, when I insert a record, and change
the customer via a TIB_LookupCombo, the OnDataChange event fires with
Field.FieldName = nil.
What's even funnier is this:
- I just put a ShowMessage(Field.FieldName) as the 2nd line of code in the
event in both versions.
- The first field to enter is the order number. So I enter a "3" and hit
tab and I get the ShowMessage message box displaying "ORDERNO".
This works identically in my D5 and D6 versions.
- The next field is customer selection via a TIB_LookupCombo. When I select
in D5 version I don't even have to tab out of that field to get the
ShowMessage
message box displaying "CUSTNO". In D6, I don't get the ShowMessage Box
AT ALL!
Conclusion:
1. I'm not totally crazy although it's late on a Friday of a extremely busy
week.
2. Something has changed possibly more in the TIB_LookupCombo instead of the
OnDataChange event.
3. For proof, I would love to have you log into my PC if you have
pcAnywhere.
4. I've tried to use the IBO Monitor, but it shows nothing to help us.
5. I could if you like create a demo application in both D5 and D6 showing
the differences.
I would also like to be able to help on debugging these kind of issues but
don't know where I would begin. I'm not familiar enough with the structure
of the source code to find what I'm looking for quickly. Any thoughts,
hints vs. me slugging thru all the files. My time is currently very limited
but would like to help out if I could.
Thanks again,
Kevin
-----Original Message-----
From: Geoff Worboys (TeamIBO) [mailto:geoff@...]
Sent: Friday, January 11, 2002 3:56 PM
To: Kevin Stanton
Subject: Re: [IBO] Problem again with OnDataChange
The datachange event has always issued some events with Field as nil,
when the change impacts the entire row and not just a single column.
It depends on exactly what you expect to be happening here, but I
would have suggested something like...
If (qryDirHdr.State in [dssEdit, dssInsert]) and
((Field = nil) or (Field.FieldName = 'CUSTNO')) then
begin
So that you pickup all changes, whether related to a single field or
the entire row. And so you avoid doing the assignments when qryDirHdr
is not in edit or insert.
One additional comment...
perhaps your assignments:
qryDirHdr.FieldByName('CUSTTERMS').AsString :=
qryCustLU.FieldByName('TruckTerms').AsString;
could be replaced by appropriate KeyDescLinks entries in the qryCustLU
table (assuming it is actually hooked up to the qryDirHdr query).
--
Geoff Worboys - TeamIBO
Telesis Computing
Yahoo! Groups Sponsor
ADVERTISEMENT
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]
Thanks for the reply.
I could show you how two programs doing exactly the same function, behave
differently.
I have my directories structured as such:
s:\development\Delphi 5 Apps\Lumber CS
and
s:\development\Delphi 6 Apps\Lumber CS
I have different .exes in both directories based on that version of Delphi
and IBO.
Here is the combo: D5 uses IBO 3.6.Cf; D6 uses IBO 4.2.Fn
When I converted my app, I simply copied the s:\development\Delphi 5
Apps\Lumber CS to the D6 directory and recompiled (with some minor changes).
I also have two shortcuts on my desktop point to each .exe.
I have just verfied the code in both D5 and D6 and the OnDataChange events
are identical.
I have also just tried added a new record in both D5 and D6 versions.
In D5, all the assignments come thru. In D6 they do not.
I have just gone into debug mode in D5, when I insert a record, and change
the customer via a TIB_LookupCombo, the OnDataChange event fires with good
data - Field.FieldName does = 'CUSTNO'.
I have just gone into debug mode in D6, when I insert a record, and change
the customer via a TIB_LookupCombo, the OnDataChange event fires with
Field.FieldName = nil.
What's even funnier is this:
- I just put a ShowMessage(Field.FieldName) as the 2nd line of code in the
event in both versions.
- The first field to enter is the order number. So I enter a "3" and hit
tab and I get the ShowMessage message box displaying "ORDERNO".
This works identically in my D5 and D6 versions.
- The next field is customer selection via a TIB_LookupCombo. When I select
in D5 version I don't even have to tab out of that field to get the
ShowMessage
message box displaying "CUSTNO". In D6, I don't get the ShowMessage Box
AT ALL!
Conclusion:
1. I'm not totally crazy although it's late on a Friday of a extremely busy
week.
2. Something has changed possibly more in the TIB_LookupCombo instead of the
OnDataChange event.
3. For proof, I would love to have you log into my PC if you have
pcAnywhere.
4. I've tried to use the IBO Monitor, but it shows nothing to help us.
5. I could if you like create a demo application in both D5 and D6 showing
the differences.
I would also like to be able to help on debugging these kind of issues but
don't know where I would begin. I'm not familiar enough with the structure
of the source code to find what I'm looking for quickly. Any thoughts,
hints vs. me slugging thru all the files. My time is currently very limited
but would like to help out if I could.
Thanks again,
Kevin
-----Original Message-----
From: Geoff Worboys (TeamIBO) [mailto:geoff@...]
Sent: Friday, January 11, 2002 3:56 PM
To: Kevin Stanton
Subject: Re: [IBO] Problem again with OnDataChange
> Thing was working fine in D5, IBO 3.6.x.Hi Kevin,
> The CustNo is hooked up to a TIB_LookupCombo on another form.
> This event is firing but the Field parameter is coming thru as nil.
> Could we get a fix on this asap please?? (or is there something new
> or something I'm missing??)
The datachange event has always issued some events with Field as nil,
when the change impacts the entire row and not just a single column.
It depends on exactly what you expect to be happening here, but I
would have suggested something like...
If (qryDirHdr.State in [dssEdit, dssInsert]) and
((Field = nil) or (Field.FieldName = 'CUSTNO')) then
begin
So that you pickup all changes, whether related to a single field or
the entire row. And so you avoid doing the assignments when qryDirHdr
is not in edit or insert.
One additional comment...
perhaps your assignments:
qryDirHdr.FieldByName('CUSTTERMS').AsString :=
qryCustLU.FieldByName('TruckTerms').AsString;
could be replaced by appropriate KeyDescLinks entries in the qryCustLU
table (assuming it is actually hooked up to the qryDirHdr query).
--
Geoff Worboys - TeamIBO
Telesis Computing
Yahoo! Groups Sponsor
ADVERTISEMENT
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
keyword-searchable FAQ, community code contributions and more !
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]