|
| |
|
|
mrjoe
Posts: 79 From: None Status: offline
|
Updating unknown amount of records? - 9/6/2001 23:54:00
Hi again,Here is a challenge. Each user in my db can have an unlimited number of corresponding records in a different table. So when a user signs in and wants to update their profile, I need to list each record from that table such that the user can makes changes or even delete then update the db. If there were a fixed number of records, that would be easy, but each user can have any number of records. I thought about creating a table were each cell contained a textbox, does that make sense? Thanks, Joe C.
|
|
|
|
Mojo
Posts: 2431 From: Chicago Status: offline
|
RE: Updating unknown amount of records? - 9/6/2001 22:59:00
Joe,I does not seem to me that an unlimited number of records is any different to update than a fixed number. I must not understand what your trying to do. I would just grab all the records, throw them in a table and add the same code to each of them that you would to a fixed number. Could you explain the exact problem your having? I thought about creating a table were each cell contained a textbox, does that make sense? That would be an easy way. Create the text boxes and when all is correct the user can hit update (or submit) and just update the records. Joe
|
|
|
|
mrjoe
Posts: 79 From: None Status: offline
|
RE: Updating unknown amount of records? - 9/7/2001 20:13:00
Hi and thanks for the reply,I knew I did a terrible job of explaining what I need  There are 2 tables in the db, table 1 and table 2 are linked via a unique record id. For example, (this is not the real data): Joe's personal info is in table 1 and in table 2 contains all his favorite colors, Red, White and Blue in 3 individual records. Spooky also in table 1 has entered Green, Yellow, Black and Brown for his colors in 4 individual records. Now, Spooky wants to change/add/delete a color, I need to list his 4 records to be updated. If Joe wants to change his colors, I need to list 3 records this time. I hope this is clear  Joe
|
|
|
|
Mojo
Posts: 2431 From: Chicago Status: offline
|
RE: Updating unknown amount of records? - 9/7/2001 13:55:00
Joe,If Spooky has the unique ID 007 in table1 (ID column) and color is a column in table2 and personal is a column in table1 you could try something like this: Select table1.personal, table1.ID, table2.color, table2.ID FROM table1, table2 WHERE table1.ID = 007 AND WHERE table2.ID = 007 I don't know how accurate the above statement is. I just kind of wrote it down, but it should give you an idea. Joe
|
|
|
|
rdouglass
Posts: 9270 From: Biddeford, ME USA Status: offline
|
RE: Updating unknown amount of records? - 9/7/2001 14:16:00
This may be too simple 'cause I may be looking at the problem wrong. However, your operative word was list so why couldn't you create a query in the DB linking the tables, then just call the query?I know it doesn't help the updating portion, but once you have your ID, etc. you should be able to update each table as required...
|
|
|
|
TimC
Posts: 199 From: Greenville SC (& or) Monterrey Mexico Status: offline
|
RE: Updating unknown amount of records? - 9/8/2001 20:45:00
Hi - Did you need to list Spooky's personal info from table 1 or just recognize that spooky is the guy in table 1 with uniqeID equal to ID # 007, so that now you can get the records that belong to spooky? If all you are using table one for is to identify spooky, [and presuming you are using the spooky login] you could use the session variable UserName in table 2 as the means of refrencing who prefers which colors as opposed to spooky's id number. I am doing about the same thing where a unique "username" from the spooky login is also the identifier for all of that persons listings in 28 different tables/product classes. I just force the user to login using spookys code then use the username session variable in the pages associated with edit/delete for that particular product class, to find all the records that belong to him.Add a variable like so Dim UserName UserName=Session("UserName") Now my sql becomes as simple as SQLstring ="Select * From tableWhatever Where UserName = '" & UserName & "'" The added benefit is that when a user wants to add records I can already identify him with a hidden value pair containing his session user name. This saves him from having to include any personal info each time he adds another listing. You can even snag and modify a working model of the code on http://www.asp101.com/samples/db_edit.asp . I would suggest dumping the first "case statement" to add records which is quite primitive, but the view, edit and delete capability from within a single page works quite nicely. It creates a table of your exisiting info and gives you the choice of edit or delete for each record in the table that it retrieves. {Which in this case is only the records that were added by that specific user} ------------------ TimC Humble Webmaster "Good things come to those who wait... . . but only that which was left by those who hustled" Abraham Lincoln
|
|
|
|
mrjoe
Posts: 79 From: None Status: offline
|
RE: Updating unknown amount of records? - 9/9/2001 17:49:00
Hi Tim,Great link, this is just what I wanted to do. Joe C.
|
|
|
|
Guest
|
RE: Updating unknown amount of records? - 9/10/2001 16:45:00
Yes, another helpful link. I'd like to do this but within FP2000 and be able to edit multiple fields and records by selecting the records via checkbox and going to an edit screen populated by the selected records.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|