 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Terry Guest
|
Posted: Fri Feb 10, 2006 9:03 pm Post subject: no current record |
|
|
using paradox 7 and D6
There is a master-detail relationship set up with an id field in the
master and one in the detail table. The detail table has a date field,
and a locate is being used on that field to find the apppropriate detail
record. The first time through ( where a detail record exists with the
date) the locate is successful. when the id is changed, and a record
with the date exists, the locate fails with 'no current record' error .
What is the problem here? |
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Fri Feb 10, 2006 9:03 pm Post subject: Re: no current record |
|
|
Terry wrote:
| Quote: | There is a master-detail relationship set up with an id field in the
|
I assume you are using two TTable components linked through the
MasterTable and MasterFields property of the detail TTable. Is that
correct?
| Quote: | master and one in the detail table. The detail table has a date
field, and a locate is being used on that field to find the
apppropriate detail record. The first time through ( where a detail
record exists with the date) the locate is successful. when the id
is changed, and a record with the date exists, the locate fails with
|
What do you mean by "when the id is changed"? Are you changing the
value of the Id column in the master table or are you just moving to a
new record in the master table?
| Quote: | 'no current record' error .
What is the problem here?
|
Impossible to say with the information provided.
--
Bill Todd (TeamB) |
|
| Back to top |
|
 |
Terry Guest
|
Posted: Fri Feb 10, 2006 10:03 pm Post subject: Re: no current record |
|
|
I use a query to select one record from the master table. there is
another query to select record(s) for the detail information. |
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Fri Feb 10, 2006 11:03 pm Post subject: Re: no current record |
|
|
Terry wrote:
| Quote: | I use a query to select one record from the master table. there is
another query to select record(s) for the detail information.
|
One more time. What do you mean by "when the id is changed"? Are you
changing the value of the Id column in the master table or are you just
moving to a new record in the master table?
Does the detail query return any rows? If you call Locate on an empty
result set you could get the error you describe.
--
Bill Todd (TeamB) |
|
| Back to top |
|
 |
Terry Guest
|
Posted: Sat Feb 11, 2006 1:03 am Post subject: Re: no current record |
|
|
Bill Todd wrote:
| Quote: | Terry wrote:
I use a query to select one record from the master table. there is
another query to select record(s) for the detail information.
One more time. What do you mean by "when the id is changed"? Are you
changing the value of the Id column in the master table or are you just
moving to a new record in the master table?
I do a new query on the master table to select one record. |
select a.staffid, s.lastname, s.firstname, a.positionid, p."position"
from "active" a, staff s, "position" p
where (a.staffid = :instaffid) and
a.staffid = s.id and a.positionid = p.id
the detail query sets its DataSource value to the master table query.
It uses a where clause to select only those records which match. id
in master table = id in detail table.
select oth_date as mydate, oth_staffid, oth_hours, oth_comment
from OtherHrs
where oth_staffid = :staffid
| Quote: |
Does the detail query return any rows? If you call Locate on an empty
result set you could get the error you describe.
in the case where I get the error, there is a record in the detail table. |
I also uses the dataset for the detail query to write a new record to
the detail table. ( after setting all the fields ).
> |
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Sat Feb 11, 2006 4:03 am Post subject: Re: no current record |
|
|
If all else fails you can find the record you want by looping through
the detail records. I have no idea what is causing the problem at this
point.
--
Bill Todd (TeamB) |
|
| Back to top |
|
 |
Wayne Niddery [TeamB] Guest
|
Posted: Sat Feb 11, 2006 6:03 pm Post subject: Re: no current record |
|
|
Terry wrote:
| Quote: |
select a.staffid, s.lastname, s.firstname, a.positionid, p."position"
from "active" a, staff s, "position" p
where (a.staffid = :instaffid) and
a.staffid = s.id and a.positionid = p.id
select oth_date as mydate, oth_staffid, oth_hours, oth_comment
from OtherHrs
where oth_staffid = :staffid
|
In the master query your parameter is "instaffid" while in the detail it is
"staffid". Try making them both "staffid".
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: http://www.logicfundamentals.com/RADBooks.html
"Bandwagons are like streetcars, there'll be another along in a few
minutes." |
|
| Back to top |
|
 |
Terry Guest
|
Posted: Sun Feb 12, 2006 2:03 pm Post subject: Re: no current record |
|
|
Wayne Niddery [TeamB] wrote:
| Quote: | Terry wrote:
select a.staffid, s.lastname, s.firstname, a.positionid, p."position"
from "active" a, staff s, "position" p
where (a.staffid = :instaffid) and
a.staffid = s.id and a.positionid = p.id
select oth_date as mydate, oth_staffid, oth_hours, oth_comment
from OtherHrs
where oth_staffid = :staffid
In the master query your parameter is "instaffid" while in the detail it is
"staffid". Try making them both "staffid".
I tried your suggestion, and the error still occurs. The problem is |
mysterious, as the app has four detail queries linked to the above
master, and only this particular one gets the error. I have since
changed the logic, and changed the query to a TTable so that the app
will run. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|