engr in IT

Results 1 to 2 of 2

Thread: engr in IT

  1. #1
    jaspreet singh Guest

    Default engr in IT

    what is the syntax to delete a record from a database by using an SQL query in ASP?

  2. #2
    Join Date
    Dec 1969

    Default RE: engr in IT

    Hi Jaspreet Singh,<BR><BR>Its quite easy to do. You can use the "delete" sql statement to do this. Have a ASP variable called "sql_delete". Then set this variable as, sql_delete="delete from tablename where fieldname=variablename"<BR>Now use the connection object of ASP like, connectionobject.Execute sql_delete,rows<BR><BR>If the fieldname type in sql statement in a variable then u use &#039;"&variablename&"&#039;, if it is a numeric value, use "&variablename&"<BR><BR>The rows variable in Execute methos holds how many rows have been affected by the query. So you can use this to code your succes or failure pages depending on the outcome<BR><BR>I hope this solves ur problem<BR>Happy programming<BR>regards<BR>Ganesh

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts