Gossamer Forum
Home : Products : DBMan : Installation :

Using db_key twice in database

Quote Reply
Using db_key twice in database
Hello. I'm hoping to get some advise on how to use db_key twice in the database. I need to write the "student_id" (my db_key field) to the db file two times. I tried to just put student_id in two different times, but it wouldn't work. Does anyone have advise?
Thanks!
Brian

Quote Reply
Re: Using db_key twice in database In reply to
You can't. The key field must be unique. It's how a database keeps track of a record.

If you want to be able to add identical Student ID's you will have to create a new field for them and use a different key field.


- Mark

Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Using db_key twice in database In reply to
Well, that explains it then. Is there any way to write the same student_id data to a new field in the database? For example, I'm trying to place the student_id about halfway through the record so that I can cut and paste half the record into a new database, which I will then import both databases into two tables in Access, which both require student_id. My Access database has 2 tables that need the student_id. I considered the relational mod, but it's too complex for such a simple task. Anyone have any other ideas? Much appreciated!

Brian

Quote Reply
Re: Using db_key twice in database In reply to
Why don't you simply copy the sections into the two different Access relations/tables. It doesn't make much sense to put the STUDENT_ID in twice.

One suggestion is to use the Relational Mod and store data that you want to import into one table in one database, then store data in another database file that will go into the second table. You can use the STUDENT_ID as the unique db_key to connect the two database files.

Regards,

Eliot Lee Wink
http://anthrotech.com/