FoxPro questions, 2 easy, 1 harder.. : )

FoxPro questions, 2 easy, 1 harder.. : )

Post by Christopher Lee Lott -- One foot in the grave and the other slippi » Mon, 27 Jul 1992 08:43:12



I am just learning to program with FoxPro 2.0  (never done anything with
databases before) and I had a couple of questions:

1) Is there anyway to check for duplicate records using asingle field as the
key that is as easy as marking the field a key when you create it (I am told
you can do this in paradox)? I am trying to avoid having to scan the whole
database as I enter each record...

2) Is there any way to avoid blank lines when doing mailing labels and having
an empty field sometimes?

3) Is there a way to transfer a data set from Quattro (as SDF is fine) into
FoxPro, and then have go through the database and add up the occurrences of
the same name? I have a large database of orders with the structure:

Order Number    Name               etc..
124234234       Doe, John
1334534         Doe, Jane
12354345        Doe, John

and I want to count up how many orders each person has... I figured some way
of sorting the database, finding the first occurrence, counting, finding next,
etc. I want to be able to do this without having to manually key in each name,
so when new customers come in they automatically get added...
(this one may not be so easy, but any and all help is appreciated)

chris

 
 
 

FoxPro questions, 2 easy, 1 harder.. : )

Post by Randy Linds » Sat, 01 Aug 1992 08:07:18



Quote:>1) Is there anyway to check for duplicate records using asingle field as the
>key that is as easy as marking the field a key when you create it (I am told
>you can do this in paradox)? I am trying to avoid having to scan the whole
>database as I enter each record...

I'm not sure what's wrong with the solution you suggest.  Just make the
single field a key, NODUPLICATES, then either let Foxpro tell you it's an
error when you attempt to add the record, or program it to seek on that
key first yourself.  You can add new keys (TAGs in a structural compact
index file are best) any time.

Quote:>2) Is there any way to avoid blank lines when doing mailing labels and having
>an empty field sometimes?

I think the Foxpro label generator does this automatically.  Anyone else
know if I'm wrong?

Quote:>3) Is there a way to transfer a data set from Quattro (as SDF is fine) into
>FoxPro, and then have go through the database and add up the occurrences of
>the same name? I have a large database of orders with the structure:

>Order Number    Name               etc..
>124234234       Doe, John
>1334534         Doe, Jane
>12354345        Doe, John

>and I want to count up how many orders each person has... I figured some way
>of sorting the database, finding the first occurrence, counting, finding next,
>etc. I want to be able to do this without having to manually key in each name,
>so when new customers come in they automatically get added...
>(this one may not be so easy, but any and all help is appreciated)

If you have an index on name, with duplicates allowed, you can just do
a scan (either with or without the SCAN statement), counting up the occurances
and writing the count to wherever.  You might also be able to do it with
nested SELECT's (SQL), but I'm not an SQL wizard yet.

Randy

 
 
 

1. 1 very hard and 1 very Easy question

Hi Folks,
1. Easy Question
        If I'm in a stored procedure window is there a search facilty
to find text like ALT-X runs a select piece of code in a query window

2. Hard Question
I'm sick of BCP so I'm writing my own BUT is there a way (hack) to
force the transactions to be non-logged ?!?!

Thanks for your time.
Jim Hynan
PS If people want the VB Code for my BCP let me know and I'll forward.

2. #DELETED !!!

3. Two questions... one easy, one hard

4. FPW 2.6 'No PARAMETER statement'

5. Hard DBGrid Question (Hard for me anyway).

6. Ad Hoc report generation...

7. FoxPro 2.5 and Menus (easy question)

8. Off topic: A question about web pages.

9. easy (I think) dbase/FoxPro question (about JOIN)

10. Easy FoxPro UI Question.

11. Easy to see, hard to put in SQL

12. query help, hard for me, I hope easy for you

13. Easy to see, hard to put in SQL