Updating user information with ASP and MS Access

  • Thread starter Thread starter xfile
  • Start date Start date
X

xfile

Hi:

Sorry about the question since I am pretty new to both Access and ASP.

My question is about the logic for updating user registration information
with an ASP form and MS Access database.

At first, I was trying to use the "update" method to do the work, and I am
thinking it might not be the right approach (although I have not made it
work yet), and I might need to do the "delete" and "insert" which make more
sense.

Kindly advise which of the approach is more appropriate, based on the
following scenario, before I devoted to too much time again. Many thanks in
advance.

Scenario: User information contains many standard data, such as first name,
last name, account name (user's e-mail address and denoted UID in database),
and RegNo (primary key, auto numbered) and so on.

The user's e-mail address (which also is UID) is also "unique" and the
original registration process will check if e-mail address has been
previously stored. If so, it will have the user to enter another e-mail
address.

I wish to retain the same procedure for checking e-mail address during their
update process (just in case, someone else used it before).

But if I use "update" command, it will prompt an error, since there is such
an e-mail address for the current user.

So I am thinking the logic of the procedures should first delete the row of
data and then perform an insert to the database, base on the unique primary
key - RegNo.


Again, many thanks for your suggestions.

PS: will cross-post to FrontPage programming as well.
 
I would not delete the record in this situation, what I would do is, when
updating an existing record, rather than checking only for a record with the
same e-mail address, check for a record with the same e-mail address and not
the same user ID. Something like: "WHERE EmailField = '" & EmailTextBox & "'
AND UserIDField <> " & UserIDTextBox

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Hi:

Thanks for the input, I am almost done with the update function, and then
will see where should I put this check statement :)

Thanks again.
 
Back
Top