Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to delete record in a db?

Status
Not open for further replies.

DeepBlerg

Technical User
Jan 13, 2001
224
AU
Hi,

I'd like a user to be able to login to a db and that's all fine but when the user presses a button saying "Finish", how could I make it so a record in a table is deleted?

Thanks very much,
Tim
 
You Should define the user not as read only user.

Try this code:

'*******************************
'Rs.CursorLocation = adUseClient
'Rs.CursorType = adOpenStatic
'Rs.LockType = adLockOptimistic
'*******************************

before the line Rs,Activeconnection = yourConn
 
Hi csilmh,

Thanks for that, but that doesn't delete an entry in a form in a database does it? That's what I'm trying to do...

--Tim
 
Easiest way I can think of is to use an SQL statement to delete the required record.
You could set it up so the FINISH button submits a form containing an ID number of the record you want to delete. Post the form to an ASP page that opens the database connection and deletes the record using an SQL statement like this:
"DELETE FROM YOURTABLE WHERE YOURTABLEID IN ("&userIDNo&")"

Then redirect the user to another page using
Response.Redirect "URL"

Hope this helps.
sjf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top