Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Calling equal values dynamically from DB fields


Message #1 by tekconsult42@h... on Mon, 11 Sep 2000 21:34:32 +0100
Hi,



Looking for a little help.  I'm working with an Access DB and would like

to query the DB to populate a table on an ASP page with member records

from a single family.  Each family member has the same member number but

are differentiated by the addition of a two-digit code in another field (a

familyID), which is added at the end. When the users login and their

member page comes up, I want each member of their family to be included

dynamically in the table.



I have searched through several Wrox tomes on ASP and databases, but

haven't found the right solution to date. Can someone point me in the

right direction?



Thanks,



Melvin

Message #2 by "Daniel Walker" <danielw@w...> on Mon, 11 Sep 2000 21:48:34 +0100
Ouch! It's not much help, but let me give you a hint for the long run.

Always have a autonumber primary key field for any table that dentifies

that record and that record alone. What you have here is a double-key

system, which - while it sounds cool at first - will only ever create

problems, believe you me. Always break you data down as much as possible, or

you'll always face probems. You could, for instance, have had a table

called "Families", which was linked to another table called "Family

members", or perhaps just "People". All members of all families could have

been in the second table, but would have had their membership of the

specific family indetified via the foriegn key from the "Families"

table... or something like that.



What it sounds like, to me, is you're trying to keep all of this data in 

the one table. That will always fail you in the end.



> Hi,

> 

> Looking for a little help.  I'm working with an Access DB and would like

> to query the DB to populate a table on an ASP page with member records

> from a single family.  Each family member has the same member number but

> are differentiated by the addition of a two-digit code in another field (a

> familyID), which is added at the end. When the users login and their

> member page comes up, I want each member of their family to be included

> dynamically in the table.

> 

> I have searched through several Wrox tomes on ASP and databases, but

> haven't found the right solution to date. Can someone point me in the

> right direction?

> 

> Thanks,

> 

> Melvin

Message #3 by "Daniel Walker" <danielw@w...> on Mon, 11 Sep 2000 21:48:34 +0100
Ouch! It's not much help, but let me give you a hint for the long run.

Always have a autonumber primary key field for any table that dentifies

that record and that record alone. What you have here is a double-key

system, which - while it sounds cool at first - will only ever create

problems, believe you me. Always break you data down as much as possible, or

you'll always face probems. You could, for instance, have had a table

called "Families", which was linked to another table called "Family

members", or perhaps just "People". All members of all families could have

been in the second table, but would have had their membership of the

specific family indetified via the foriegn key from the "Families"

table... or something like that.



What it sounds like, to me, is you're trying to keep all of this data in 

the one table. That will always fail you in the end.



> Hi,

> 

> Looking for a little help.  I'm working with an Access DB and would like

> to query the DB to populate a table on an ASP page with member records

> from a single family.  Each family member has the same member number but

> are differentiated by the addition of a two-digit code in another field (a

> familyID), which is added at the end. When the users login and their

> member page comes up, I want each member of their family to be included

> dynamically in the table.

> 

> I have searched through several Wrox tomes on ASP and databases, but

> haven't found the right solution to date. Can someone point me in the

> right direction?

> 

> Thanks,

> 

> Melvin





Message #4 by tekconsult42@h... on Mon, 11 Sep 2000 21:34:32 +0100
Hi,



Looking for a little help.  I'm working with an Access DB and would like

to query the DB to populate a table on an ASP page with member records

from a single family.  Each family member has the same member number but

are differentiated by the addition of a two-digit code in another field (a

familyID), which is added at the end. When the users login and their

member page comes up, I want each member of their family to be included

dynamically in the table.



I have searched through several Wrox tomes on ASP and databases, but

haven't found the right solution to date. Can someone point me in the

right direction?



Thanks,



Melvin





Message #5 by tekconsult42@h... on Tue, 12 Sep 2000 20:23:43 +0100
Daniel, thanks for the advice.  I apologize if I suggested that the data

fields that I detailed is a primary DB or recordID key.  They are not.

Each member record has its own unique identifier in the form of a long

integer, but each family has a familyID in the form of a 9-digit integer,

joined by a two-digit number. The difference, as you have indicated, is

huge. Because the two family variables are joined in practice, there is no

duplication of records, as you might think, and it has been working quite

well, thank you, on a mid-range system for over 7 years now. :-)



As to my original posting, I'm almost there with a solution, having

created a workable query this morning. When its finished cooking, I will

post it.  In the meantime, if someone has a known option that works for

them, I would like to hear it.



TIA

Message #6 by "Ken Schaefer" <ken@a...> on Wed, 13 Sep 2000 12:16:41 +1000
SELECT field1, field2, field3

FROM table1

WHERE MemberNumber LIKE 12345667__



the _ is a one character wildcard in ANSI SQL



Does this help? (I'm not sure I understand your question exactly...)



Cheers

Ken



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

From: <tekconsult42@h...>

To: "ASP Databases" <asp_databases@p...>

Sent: Tuesday, September 12, 2000 6:34 AM

Subject: [asp_databases] Calling equal values dynamically from DB fields





> Hi,

>

> Looking for a little help.  I'm working with an Access DB and would like

> to query the DB to populate a table on an ASP page with member records

> from a single family.  Each family member has the same member number but

> are differentiated by the addition of a two-digit code in another field (a

> familyID), which is added at the end. When the users login and their

> member page comes up, I want each member of their family to be included

> dynamically in the table.

>

> I have searched through several Wrox tomes on ASP and databases, but

> haven't found the right solution to date. Can someone point me in the

> right direction?

>

> Thanks,

>

> Melvin






  Return to Index