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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unwanted multiple transactions occurring

Status
Not open for further replies.

struth

Programmer
Aug 26, 2001
114
GB
I received a report from one of my users that a when they requested a single record delete from a multiple delete form (via checkboxes) ... it then deleted all their records!

I have tried to replicate this but i can't. I was once told that proxy servers can muck up transactions in this way.

Here is the delete command:

[blue]
set comDeleteActivity = Server.CreateObject("ADODB.Command")
comDeleteActivity.ActiveConnection = MM_connNOF_Data_STRING
comDeleteActivity.CommandText = "DELETE FROM Activities WHERE Activity_ID IN (" + Replace(varACT, "'", "''") + ")"
comDeleteActivity.CommandType = 1
comDeleteActivity.CommandTimeout = 0
comDeleteActivity.Prepared = true
comDeleteActivity.Execute()
[/blue]

Can I limit this transaction down better in some way.

tia

"Away from the actual ... everything is virtual"
 
maybe do a count of the records ticked first, if there is only one then, message asking user are they sure then : delete from activities where id = act
if the counts is > 1 then
messge first asking the user are they sure : then delete from actviities where id in (act)

sound like user error to me.
 
Why are you using "IN" instead of "=" in your SQL? Using "=" will limit it to one record if there are no duplicte Activity_IDs.

If there are duplicate Activity_IDs then you need to add further qualification, specifying other fields to match.
 
Thanks for your input. I have put both your ideas into action and I have seen another error myself in that I hadn't tidied up.... comDeleteActivity.ActiveConnection.close.

Thanks again.

"Away from the actual ... everything is virtual"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top