🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.database.ado
3 messages
3 total messages Started by Caleb Fri, 19 May 2006 03:35
ADO Table -> Tempermental Locate Staement -- Any clues?
#474
Author: Caleb
Date: Fri, 19 May 2006 03:35
31 lines
1614 bytes
I am using the following code to locate a rec in a table, and it
usually works in other functions and projects.

For some reason the result is false (locate unsuccessful).

I've verified that the record should be found.

Any ideas as to why it might not work?  



CODE SAMPLE

   if(ADOTabUsers->Active == true)
      ADOTabUsers->Active = false;

   ADOTabUsers->CursorLocation = clUseClient;
   ADOTabUsers->TableDirect = true;
   ADOTabUsers->TableName = "Custs";
   ADOTabUsers->IndexFieldNames = "UserID";

   ADOTabUsers->Active = true;
   Variant varT ;
   varT = Variant (user);
   varT.ChangeType(varString);
   ADOTabUsers->Locate("UserID", varT,
      TLocateOptions() << loCaseInsensitive << loPartialKey);


Is there a limit on the number of ADOTables in a program?  
Re: ADO Table -> Tempermental Locate Staement -- Any clues?
#475
Author: Caleb
Date: Fri, 19 May 2006 04:10
13 lines
1365 bytes
On Thu, 18 May 2006 23:35:45 -0400, Caleb <nospam@nospam.net> wrote:
I've verified that the record should be found.
>
>Any ideas as to why it might not work?  


FWIW I found the locate rec problem solved when trimming the leading
and trailing spaces of the lookup field.

   lookupAnsiString = lookupAnsiString.Trim();
   Locate(FieldName, lookupAnsiString, Opts)

I don't understand why partial lookup option did not find a rec.  
Re: ADO Table -> Tempermental Locate Staement -- Any clues?
#476
Author: Bud Manz
Date: Mon, 22 May 2006 23:37
33 lines
1885 bytes
Caleb wrote:
> I am using the following code to locate a rec in a table, and it
> usually works in other functions and projects.
> 
> For some reason the result is false (locate unsuccessful).
> 
> I've verified that the record should be found.
> 
> Any ideas as to why it might not work?  
> 
> 
> 
> CODE SAMPLE
> 
>    if(ADOTabUsers->Active == true)
>       ADOTabUsers->Active = false;
> 
>    ADOTabUsers->CursorLocation = clUseClient;
>    ADOTabUsers->TableDirect = true;
>    ADOTabUsers->TableName = "Custs";
>    ADOTabUsers->IndexFieldNames = "UserID";
> 
>    ADOTabUsers->Active = true;
>    Variant varT ;
>    varT = Variant (user);
>    varT.ChangeType(varString);
>    ADOTabUsers->Locate("UserID", varT,
>       TLocateOptions() << loCaseInsensitive << loPartialKey);
> 
> 
> Is there a limit on the number of ADOTables in a program?  
> 
Are you sure you have a good connection to the database?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads