🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #311

Basic fetch record question

#311
From: crhras
Date: Sat, 22 Jul 2006 02:09
22 lines
1658 bytes
I have a database of phone numbers and names like this:

phone VARCHAR(10);
name VARCHAR(20);

I want to be able to enter a phone number and check the database for a match 
and if found, display the name.  If a match is not found, then a name can be 
entered and a new record will be added.

The problem is I am using TDBEdit controls on the form which display the 
current value of the data fields to which they are linked.  How can I blank 
the DBEdit control out and allow it to accept the phone number which I will 
be searching on.

If phone number is the primary key then I can do it by calling SetKey() then 
EditKey() on the ClientDataSet and ReadOnly = false on the phone TDBEdit. 
But what if the phone number is not the primary key and I want to use 
Locate() instead to find the matching phone number ?

In advance,
Thank you,
Curt
Technical Details
Message-ID: <44c188e0$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,2055e5449f3325c0,start
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "crhras" <crhras@sbcglobal.net>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: Basic fetch record question
Date: Fri, 21 Jul 2006 21:09:39 -0500
Lines: 25
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
X-RFC2646: Format=Flowed; Original
NNTP-Posting-Host: 75.22.20.59
Message-ID: <44c188e0$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1153534176 75.22.20.59 (21 Jul 2006 19:09:36 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail