...

View Full Version : Did the Delete Sql Command work?



jaywhy13
01-07-2005, 03:14 AM
del="DELETE FROM users WHERE user='" & admin & "'"
Conn.execute del

In the same way that I can check if a command or a record exists by checking if objRS.EOF is true, is there a way that I can check if the Delete command exists because it does not return an error if no record matches the criteria that was executed to be deleted!

So how do I know that the operation was successful without having to do a SELECT FROM users WHERE username=blah blah and checking if the recordset is empty? :confused:

glenngv
01-07-2005, 05:21 AM
Specify the optional second argument to the Execute method, it tells how many records are affected by the query.


dim ctr
ctr = 0
del="DELETE FROM users WHERE user='" & admin & "'"
Conn.execute del, ctr
if ctr = 0 then
response.write "No record(s) deleted"
end if

jaywhy13
01-07-2005, 07:18 AM
thanks man... works like a charm



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum