Microsoft Access Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft Access Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 4th, 2004, 02:07 PM
ThaGeza ThaGeza is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 ThaGeza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Simple Realtionship Problem

hi evry1, i hope someone can help me with this simple database relationship problem:


i am trying to link 2 tables lets call them A and B. I am creating a relationship between the two tables (with enforced referential integrity) but i get the error message 'Relationship must be on the same number of fields with the same data types'. I know that the data types between the two attributes i am joining are different this is why the error is occuring, so to avoid it you would abviously make sure that they are the same data type, but i cannot change the data type due to user requirements.
So how do i get around this error message? or is it impossible?

your help is greatly appreciated,
regards,
ThaGeza

Reply With Quote
  #2  
Old February 4th, 2004, 02:23 PM
dsomers dsomers is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Winston-Salem, NC
Posts: 198 dsomers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
What data types are the PK in one table and the FK in the other table? If I have a PK set as integer in my table and I want to link that to another table as a FK, I need to make sure that it is set to integer as well for when you start to store the data you can't save an integer into a field that is set as a String or date.

Later,
David Somers

Reply With Quote
  #3  
Old February 4th, 2004, 02:49 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
Yes they have to be the same

What is your user requirements that makes you thingk you need them different. Mayben we can ehlp you get around this and still met your user requirements.

S-

Reply With Quote
  #4  
Old February 4th, 2004, 06:08 PM
ThaGeza ThaGeza is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 ThaGeza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
The PK is of datatype 'Long integer' and the FK is 'integer'.

Is there any method to cast one into the other, or something like that. Or does a 'link' table need to be made? such as A_B if you see what i mean.

The user requirement states clearly that the attribute needs to be of type long integer in one table and of type integer in another table. maybe they forgot to add the word 'long' in the second sentence, i will have to make sure.

cheers,
Geza

Reply With Quote
  #5  
Old February 4th, 2004, 11:05 PM
sbaxter sbaxter is offline
Moderator: Access, SQL
ASP Free God (5000 - 5499 posts)
 
Join Date: Oct 2003
Posts: 5,126 sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level)sbaxter User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 Days 1 h 2 m 51 sec
Reputation Power: 12
their user requirements are wrong by default. It doesn't matter what DB you were to create this in the field type, by design and by theory are the same or a relationship can't exist. Just change it. They won't even know and if they do notice, then tell them that their specs were inacurate and that it wouldn't work they way they specified.

S-

Reply With Quote
  #6  
Old February 5th, 2004, 01:51 PM
ThaGeza ThaGeza is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 3 ThaGeza User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
i found out it was an error in the user requirements, the primary key and the foreign key are meant to be the same data type, thus the error does not occur anymore.

thanks for the help people,
ThaGeza

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft Access Help > Simple Realtionship Problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway