Help using LOCATE with delphi 3.02 
Author Message
 Help using LOCATE with delphi 3.02

Please help !!!! I'm using delphi 3.

I'm trying to find one or more records in an Access table and am using
LOCATE to retrieve it. This works fine for a LOCATE on just one key field,
but doesn't if your are trying to find a record using two fields (whether an
key or not).

The procedure looks like this:

procedure TfmSites.DeleteRelationship (W_parent:string; W_component:string);
//
// Delete a Parent-component relationhip from file
//
begin

  with smsdb.parent_d do
    if (Locate('site; component', VarArrayOf([W_parent,W_component]), []))
then
      smsdb.parent_d.delete;

  with smsdb.component_d do
    if (Locate('Site; Parent', VarArrayOf([W_component,W_parent]), [])) then
      smsdb.component_d.delete;

end;

Parent_D has site as a keyed field (linked to another table), as does
Component_D. The fields "Component" and "Parent" in each of the respective
tables is not an indexed field (though making them so does not make a
difference - when I say that, I mean indexed as in indexed but not linked to
another table).

Please ! What *AM* I doing wrong ? What is the best method to retrieve a
record that if I know the values of one or more of the fields, irrespective
of wheter they are indexed or not ? The manual and help files suggest using
LOCATE, but I can't see for love nor money, why it's not doing what I think
it should.


TIA :)



Thu, 12 Apr 2001 02:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. BCD Field using Delphi 3.02 and Oracle

2. access and Delphi 3.02

3. Access 97, Delphi 3.02 and the Memo field ...

4. Delphi 3.02, ODBC and Oracle8i 8.1.5.0.0

5. Paradox index problem with Delphi 3.02 /BDE 4.01

6. Delphi 3.02 & Foxpro Tables - No Apollo

7. Delphi 3.02/ODBC/Ingres DB

8. Delphi 3.02 and Informix 4.0 native driver

9. Changing ODBC settings from Delphi 3.02

10. Using Locate method in Delphi 2

11. Help using the TTable.Locate command

12. Help : Using LOCATE with multiple fields

 

 
Powered by phpBB® Forum Software