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

How to write a delete statement?

Status
Not open for further replies.

LovelyGirl

Programmer
Oct 13, 2001
12
QA
Someone please help.

How can I delete from the database if the WHERE condition icludes the operator IN (variable or request.form("y")), y is set of numbers such as 1, 2, 3,...etc.
By the way I wrote the folloowin query but it did not work:

"Delete From x Where a IN ('" & reguest.form("y") & "')"

And thanks in advance.
 
<%' this may help..
dim pkey
pkey = split(request.form(&quot;pkey&quot;),&quot;'&quot;)
for x = 0 to ubound(pkey)
sql = &quot;delete * from [my table] where primarykey=&quot; & pkey(x)
myconn.execute(sql)

Next 'moves to next in array..
%>


'pkey = id number
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top