Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Boudewijn Lutgerink
  Where is Boudewijn Lutgerink?
 Hoonaardstraat, Driel
 Netherlands
 Boudewijn Lutgerink
 To: yudi
  Where is yudi?
 Dps
 Indonesia
 yudi
 Tags
Subject: RE: How to do automated field entry?
Thread ID: 92395 Message ID: 92413 # Views: 33 # Ratings: 1
Version: Visual FoxPro 8 Category: Databases, Tables and SQL Server
Date: Sunday, April 02, 2006 9:11:53 AM         
   


> Well..
> I thought putting all payment data in a table is not a good idea, because the 254 fields limitation in a table.
>
> Well, what's the most effective and simple way?
>
> I am willing to make a change


create table monthlypayments ( paymentID I autoinc, studentID I, year i, month I, amount Y)

In one record you then store the id of the student, the year and month when the payment was done, and the amount.

All in all the recordsize is 25 bytes.

You do not need the name of the student as that is in the master table already.

The paymentID is a unique identifier for the record and should therefore be an autoincrement field.

This way you have all the information available.
It most definetely will be quite a job to store all the info form those payment tables in one table but that is just the way it is.
It is the penalty for poor database design.
But you only have to do that once.

If this is set and you should wish to alter the ID for the student (bad idea to start with) all you have to do is:
Update MonthlyPayments ;
   set StudentID = NewID ;
 where StudentID = OldID


this can be put in a trigger, so the users have nothing to do with that.

Boudewijn LutgeĀ®ink
My Blog is here


COMPLETE THREAD

How to do automated field entry? Posted by yudi @ 4/2/2006 5:33:02 AM
RE: How to do automated field entry? Posted by Jamie Osborn @ 4/2/2006 6:01:01 AM
RE: How to do automated field entry? Posted by yudi @ 4/2/2006 6:13:13 AM
RE: How to do automated field entry? Posted by Jojo Sabino @ 4/2/2006 6:42:31 AM
RE: How to do automated field entry? Posted by yudi @ 4/2/2006 8:01:17 AM
RE: How to do automated field entry? Posted by Jamie Osborn @ 4/2/2006 7:00:52 AM
RE: How to do automated field entry? Posted by yudi @ 4/2/2006 8:09:16 AM
RE: How to do automated field entry? Posted by Boudewijn Lutgerink @ 4/2/2006 9:11:53 AM
RE: How to do automated field entry? Posted by Jamie Osborn @ 4/2/2006 2:19:24 PM
RE: How to do automated field entry? Posted by William Sanders @ 4/3/2006 8:17:19 AM
RE: How to do automated field entry? Posted by Barbara Peisch @ 4/3/2006 8:23:21 PM
RE: How to do automated field entry? Posted by Ken Murphy @ 4/3/2006 8:58:26 PM