Can I ask you something?
While using Delphi, I happended to wonder about something.
So to speak, I want to ask regarding TABLE.
Let me tell you my story.
I created a Table with three fields.
The fields are as follows.
<Table>
field name remark
Code 1)Primary Key : Record
Name 2)Secondary Key : Name+Phone ( not unique)
Phone
After creating the above Table and doing something needed to execute
program,
I actually input data.
example)
Code Name Phone
000001 D Kim 972-8266
000002 B Park 575-1223
000003 C Yoon 234-2222
000004 D Kim *
While I input data, An error occurred...
At the position of *, An error happend like this,, " Key Violation"
/*----------------------------------------------------------------*/
Now I ask you..
Why do you think the key error occurred??
As I wrote, I set Code ( not Name+Phone) as primary key.
Is there anything wrong with Secondary Key( Name + Code)?
You may notice the position where error occurred.
If you have answer or any comment on creating Table or setting key ,
please email to me.
/*----------------------------------------------------------------*/
I am looking foward to hearing from you.
I thank you in advance..
My email address is as follows.
tjs...@untel.co.kr
bye.
>>While I input data, An error occurred...
>>
>>At the position of *, An error happend like this,, " Key Violation"
>>
>>/*----------------------------------------------------------------*/
>>Now I ask you..
>>Why do you think the key error occurred??
Your primary key in the table is obviously on the Name field, so you
cannot have the same name entered twice.
Change the primary key so that it includes your Code field, if that
will be a unique number for every record. That will solve your
problem.
Christopher di Armani
Dolphin Software Solutions Phone (604)739-1336 Fax (604)739-1188
#256-1917 West 4th Avenue email dolphin_...@axionet.com
Vancouver, BC V7J 1M7 http://www.wp.com/dolphin/dss.html
Canada