syntax in ASP for deleting a row in a table

A

Andrew Murray

could anyone give me a quick tip on the correct syntax to delete/modify a
record/row in an Access table (using SQL query I suppose) and VBScript/ASP ?

as in

I have a form where a user inputs user id and password; I want to have another
form where they can delete their details

eg they do a search on user name and it brings up their record; then they click a
link "Delete" and or Modify (say the want to change password).

I'm guessing here but something is it something like this:
Table called Users

<%
SELECT Users WHERE (Username=::Username:: AND Password=::password::).???
Response.write(Password)
%>

So it checks there is such a user, then allows the change to the password.
response.write writes the new password back to the table.

how do I write the new (changed) details to this?

For delete is the ASP/Query like:

DELETE RECORD where Username=[::Username::] AND PASSWORD=[::password::].



--
Andrew Murray
Remove NOSPAM or SPAM BUSTER to reply
to reply

Outgoing message has been scanned with Norton Antivirus..
 
T

Thomas A. Rowe

I would have the user login first, then use the record ID to delete the record.

Delete * From Tablename Where ID = " & Request.Form("RecID")


To actually use your statement, I would write it like:

Delete * From Users WHERE Username='" & Username & "' AND Password='" & Password &"' "

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top