Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Rob Vleeschhouwer
  Where is Rob Vleeschhouwer?
 Leeuwarden
 Netherlands
 Rob Vleeschhouwer
 To: Marcia Akins
  Where is Marcia Akins?
 Akorn
 Ohio - United States
 Marcia Akins
 Tags
Subject: RE: Primary key
Thread ID: 104515 Message ID: 104548 # Views: 2 # Ratings: 0
Version: Visual FoxPro 9 Category: Databases, Tables and SQL Server
Date: Thursday, August 17, 2006 2:12:04 PM         
   


> Is it possible to combine two fields for a primary key.
> In a orderform an articlenumber can be used twice, or more.
> So I will combine it with the field amount(m2). Making simple this two fields as primary key doesn't work.

>
> PKs should not have intelligence. You should be using surrogate PKs so why not just go with an identity column?
>

I had the same idea, but it can happen that the user must use a new record.
No problem to make a hotkey with 'append blank'. But then I have to fill that
identity column with, lets say max(nmax,identity)+1
Then comes VFP with an error about an unsaved record or something like:
can insert blank record in basic table from a view. It is also a problem
to fill te keyfield with max(nmax,keyfield)+1

Rob

ENTIRE THREAD

Primary key Posted by Rob @ 8/17/2006 11:15:56 AM
RE: Primary key Posted by Bert Murillo @ 8/17/2006 11:27:43 AM
RE: Primary key Posted by Rob @ 8/17/2006 12:01:10 PM
RE: Primary key Posted by Bert Murillo @ 8/17/2006 12:45:03 PM
RE: Primary key Posted by Borislav Borissov @ 8/17/2006 11:36:23 AM
RE: Primary key Posted by Rob @ 8/17/2006 11:59:13 AM
RE: Primary key Posted by Borislav Borissov @ 8/17/2006 12:36:46 PM
RE: Primary key Posted by Marcia Akins @ 8/17/2006 12:29:32 PM
RE: Primary key Posted by Rob @ 8/17/2006 2:12:04 PM
RE: Primary key Posted by Borislav Borissov @ 8/17/2006 2:22:12 PM
RE: Primary key Posted by Koen Piller @ 8/17/2006 12:56:59 PM