|
| |
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
Update DB Record if Pswd Matches - 1/19/2002 8:31:33
Hello, I have a database with id, firstname, lastname, password, & data. I would like to allow a user to update "their" record (firstname, lastname, password, &/or data fields), if they know the password. I'm thinking that in form one (on page one) that they would select their name from a dropdown of lastname, firstname and then enter their password. When they press "submit" then form 2 (also on page one) would display their current database fields, where they could also type in what they want changed. When they press "submit" on form two then the information would be posted to a second page where I use an SQL statement to "update distinctrow". I don't have much of a clue as to how I can do this. I couldn't find any past threads that really helped. Any guidance would be appreciated. Thanks in advance, Andrew Andrew webmaster@serenitynet.net - - - - - - - - - - - - "But the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness, and self-control..." Gal. 5:22
|
|
|
|
arnie
Posts: 209 From: Gobbler Knob, Indiana Status: offline
|
RE: Update DB Record if Pswd Matches - 1/19/2002 10:34:38
Hi Andrew- I've managed to make that happen. I don't know that it's the best way, but I'll try to explain: Two tables in db. One is password table with username & password fields. Make the username & password fields also show up in the table with the data fields. In Access, make the relationships show dual ref integrity (username & password). To do that, select both fields in the password table (hold down ctrl), and drag to the data table (& select both field names and ref integrity in the resulting box.) Once this is done, you can use the tutorial on updating at http://www.sitebuilder.ws to do the rest. (I'm sure Spooky Login will easily do it, but I've not yet tried it.) Arnie Howes "Truer words were never spoken through falser teeth" Edited by - arnie on 01/19/2002 10:36:28
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: Update DB Record if Pswd Matches - 1/19/2002 11:15:55
Hi Arnie, What you've suggested is ultimately what I'm wanting to do as I expand, so I'll try it now. I'm trying to create the database tables with the dual ref integrity, but without success. I've made two tables in the same DB. I've tried dragging the username and password fields to the "data" table (holding the ctrl key down) both when the "data" table doesn't have those two fields and when I've added same the two fields. They don't drag and no dialog box pops up. I've tried this in both design and table view. Any ideas what I'm doing wrong? Thanks, Andrew Andrew webmaster@serenitynet.net - - - - - - - - - - - - "But the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness, and self-control..." Gal. 5:22
|
|
|
|
arnie
Posts: 209 From: Gobbler Knob, Indiana Status: offline
|
RE: Update DB Record if Pswd Matches - 1/19/2002 14:06:39
I don't know what your Access knowledge level is. Let's assume total novice so that I don't assume too much. With the identical fields existing in both tables, click on the relationship button in the toolbar (it looks like table icons with lines connecting them). Right Click in the background of the relationship window that pops up and choose to show both tables. Once both show, click on username in the password table. Then, while holding down the ctrl key, click on password (also in the password table.) With both now highlighted, drag them over to the data table and drop. A box should pop up. In that box, there will be two columns. The password table will show in the left column. Go to the right column (data table) and make username appear across from its counterpart, and likewise for password. There will be a check box in the dialog box that allows you to "Enforce referential integrity". Click it and then click OK. The db should now prohibit anything being entered into the data table without a matching username and password. ***If anyone knows a simpler method, don't let me teach the hard way here... Arnie Howes "Truer words were never spoken through falser teeth"
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: Update DB Record if Pswd Matches - 1/19/2002 15:48:48
Hello Again, I've followed your instructions, without a problem, until I press on the "create" button after creating the realationship. When I do so then I get the following error message, "No unique index found for the referenced field of the primary table." and cannot proceed any further. I've tried about every logical combination of primary keys and index fields (allowing and not allowing duplicates), without any success. If you can guide me one step furhter then I think I'll have it! Thanks again, Andrew Andrew webmaster@serenitynet.net - - - - - - - - - - - - "But the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness, and self-control..." Gal. 5:22
|
|
|
|
arnie
Posts: 209 From: Gobbler Knob, Indiana Status: offline
|
RE: Update DB Record if Pswd Matches - 1/19/2002 16:41:02
I know you'll have it. Then you'll just need to follow the tutorial on http://sitebuilder.ws. If I remember correctly, you'll need to open the password table in design. Then, click on username > hold down ctrl > click on password > right click in the highlighted area > choose "primary key" Almost there... Arnie Howes "Truer words were never spoken through falser teeth"
|
|
|
|
arnie
Posts: 209 From: Gobbler Knob, Indiana Status: offline
|
RE: Update DB Record if Pswd Matches - 1/19/2002 16:42:55
Don't allow duplicates. Arnie Howes "Truer words were never spoken through falser teeth"
|
|
|
|
SerenityNet
Posts: 1372 Joined: 6/12/2001 From: Allen, TX, USA Status: offline
|
RE: Update DB Record if Pswd Matches - 1/19/2002 18:15:47
Got it! I never knew you could have two primary keys and that is what it needed. I don't care if passwords are duplicated, as long as username is unique, so I allowed duplicates on the password. Access didn't seem to mind, so I'll try it. After reading the help dialogs, I chose to allow the cascading options. It is what I will want. I don't have time to finish this out right now, but I've printed the SiteBuilder tutorial and given it a quick glance. I'm pretty sure it will fill in any gaps I have. Thank you so very much for the help. This is just another reason why the OutFront forum is absolutely the best forum on the web! Thanks again, Andrew Andrew webmaster@serenitynet.net - - - - - - - - - - - - "But the fruit of the Spirit is love, joy, peace, patience, kindness, goodness, faithfulness, gentleness, and self-control..." Gal. 5:22
|
|
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
|
|
|