Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Problem with Database Tables


Message #1 by "Mitten" <mittenshah@h...> on Wed, 15 Aug 2001 19:35:02
I am having probelms with my database tables, ok, I have 3 tables in my 

database namely Author, Writes and Article. The Author Table has an 

AuthorID,FName,LName. the Writes table contains AuthorID(fk) and ArticleID

(fk). And the writes table has ArticleID, Title,Year,Journal.



Now i am getting stuck, when a article is written by more than one author, 

how do i ensure that Article1 is written by two authors? do i need to 

change my primary key from autonumber to number? And i would like to point 

out that i am entering these details via a form on a webpage.



Thanks
Message #2 by r-armbrust@n... on Fri, 17 Aug 2001 18:49:58
Just create multiple records in the Writes table (one for every author).  

Then you can just query the database for duplicate records.  The reason 

for having the Writes table is so you can a many-to-many relationship 

(i.e. multiple authors per article and vice versa).

hope this helps

rick



> I am having probelms with my database tables, ok, I have 3 tables in my 

> database namely Author, Writes and Article. The Author Table has an 

> AuthorID,FName,LName. the Writes table contains AuthorID(fk) and 

ArticleID

> (fk). And the writes table has ArticleID, Title,Year,Journal.

> 

> Now i am getting stuck, when a article is written by more than one 

author, 

> how do i ensure that Article1 is written by two authors? do i need to 

> change my primary key from autonumber to number? And i would like to 

point 

> out that i am entering these details via a form on a webpage.

> 

> Thanks
Message #3 by "Mitten" <mittenshah@h...> on Sun, 19 Aug 2001 00:17:11
Hi Thanks for your reply, but im just confused on how to insert multiple 

authors per article and vice versa, is there an insert statement i have to 

use or what? i have got no clue how to do this. Could you please show me 

an example.



Thanks



> Just create multiple records in the Writes table (one for every 

author).  

> Then you can just query the database for duplicate records.  The reason 

> for having the Writes table is so you can a many-to-many relationship 

> (i.e. multiple authors per article and vice versa).

> hope this helps

> rick

> 

> > I am having probelms with my database tables, ok, I have 3 tables in 

my 

> > database namely Author, Writes and Article. The Author Table has an 

> > AuthorID,FName,LName. the Writes table contains AuthorID(fk) and 

> ArticleID

> > (fk). And the writes table has ArticleID, Title,Year,Journal.

> > 

> > Now i am getting stuck, when a article is written by more than one 

> author, 

> > how do i ensure that Article1 is written by two authors? do i need to 

> > change my primary key from autonumber to number? And i would like to 

> point 

> > out that i am entering these details via a form on a webpage.

> > 

> > Thanks
Message #4 by "Mitten" <mittenshah@h...> on Sat, 18 Aug 2001 19:32:56
Hi Rick, im kind of confused of the SQL INSERT Statement i should use in 

order to create multiple records in the writes table. Please could you 

show me how to use the SQL INSERT Query to do this



 Just create multiple records in the Writes table (one for every author).  

 Then you can just query the database for duplicate records.  The reason 

 for having the Writes table is so you can a many-to-many relationship 

 (i.e. multiple authors per article and vice versa).

 hope this helps

 rick

 

 I am having probelms with my database tables, ok, I have 3 tables in my 

 database namely Author, Writes and Article. The Author Table has an 

 AuthorID,FName,LName. the Writes table contains AuthorID(fk) and 

 ArticleID(fk). And the writes table has ArticleID, Title,Year,Journal.

 Now i am getting stuck, when a article is written by more than one 

 author, how do i ensure that Article1 is written by two authors? do i 

need to change my primary key from autonumber to number? And i would like 

to point  out that i am entering these details via a form on a webpage.

 

 Thanks











Message #5 by mmcpheat@s... on Tue, 21 Aug 2001 09:21:53 +0800

INSERT INTO Articles (Title,Year,Journal) VALUES

('TitleName',2001,'JournalName')



Get the ArticleID



INSERT INTO Writes (AuthorID,ArticleID) VALUES (FirstAuthID, MyArticleID)

INSERT INTO Writes (AuthorID,ArticleID) VALUES (SecondAuthID, MyArticleID)





-----Original Message-----

From: Mitten [mailto:mittenshah@h...]

Sent: Sunday, 19 August 2001 3:33 AM

To: Access ASP

Subject: [access_asp] Re: Problem with Database Tables





Hi Rick, im kind of confused of the SQL INSERT Statement i should use in 

order to create multiple records in the writes table. Please could you 

show me how to use the SQL INSERT Query to do this



 Just create multiple records in the Writes table (one for every author).  

 Then you can just query the database for duplicate records.  The reason 

 for having the Writes table is so you can a many-to-many relationship 

 (i.e. multiple authors per article and vice versa).

 hope this helps

 rick

 

 I am having probelms with my database tables, ok, I have 3 tables in my 

 database namely Author, Writes and Article. The Author Table has an 

 AuthorID,FName,LName. the Writes table contains AuthorID(fk) and 

 ArticleID(fk). And the writes table has ArticleID, Title,Year,Journal.

 Now i am getting stuck, when a article is written by more than one 

 author, how do i ensure that Article1 is written by two authors? do i 

need to change my primary key from autonumber to number? And i would like 

to point  out that i am entering these details via a form on a webpage.

 

 Thanks








  Return to Index