Author |
Topic  |
|
Freeman II
Junior Member
 
232 Posts |
Posted - 01 August 2001 : 18:14:52
|
im making a mass approve, delete, addon for the Link Manager mod.
this is what i have
do while not rs.eof Link... Description... <input type="radio" name="<% =rs("LINK_ID") %>" value="1" checked>Approve <input type="radio" name="<% =rs("LINK_ID") %>" value="0">Delete rs.movenext loop <input type="submit" Value="Submit">
how do i make a list for links to be deleted and a list for links to be approved so i can use the IN statement to update those links [something like IN (" & strDeleteList & ")]
|
|
Freeman II
Junior Member
 
232 Posts |
Posted - 02 August 2001 : 22:33:21
|
any idea?
|
 |
|
RaiderUK
Average Member
  
United Kingdom
577 Posts |
Posted - 03 August 2001 : 04:37:06
|
do while not rs.eof Link... Description... <input type="radio" name="Approve" value="<% =rs("LINK_ID") %>" >checked>Approve <input type="radio" name="Delete" value="<% =rs("LINK_ID") %>" >Delete rs.movenext loop <input type="submit" Value="Submit">
approve:
Dim strToApprove, i strToApprove = Request.Form("approve") strToApprove = Split(strToApprove, ",")
For each i in strToApprove // Your SQL statment // example "Update from yourTable (approved = " & 1 &") where ID = "& i next
Do the same with delete but with a delete statment.
Edited by - RaiderUK on 03 August 2001 04:40:15 |
 |
|
RaiderUK
Average Member
  
United Kingdom
577 Posts |
Posted - 03 August 2001 : 04:58:01
|
for the delete use this:
Dim strDelItems, strDelItemsSplit, i
strDelItems = Request.Form("delete") strDelItemsSplit = Split(strItems, ",")
for each i in strDelItemsSplit
set Command1 = Server.CreateObject("ADODB.Command") Command1.ActiveConnection = YourConnectionString Command1.CommandText = "DELETE FROM tbl_links WHERE ID = " & cInt(i) Command1.CommandType = 1 Command1.CommandTimeout = 0 Command1.Prepared = true Command1.Execute()
next
|
 |
|
mrWize
deleted
 
119 Posts |
Posted - 03 August 2001 : 11:15:59
|
No, No!!
us the IN statement!!!!
Dim strDelItems, strDelItemsSplit, i
strDelItems = Request.Form("delete")
strSQL = "DELETE FROM tbl_links WHERE ID IN (" & strDelItems & ")"
set objConn = Server.CreateObject("ADODB.Connection")
objConn.ActiveConnection = YourConnectionString objConn.Open objConn.Execute() objConn.Close Set objConn = Nothing
cya, mrWize
Edited by - mrWize on 03 August 2001 11:16:54 |
 |
|
mrWize
deleted
 
119 Posts |
Posted - 03 August 2001 : 11:19:40
|
And for updates:
Dim strUpdItems
strUpdItems = Request.Form("approve")
strSQL = "UPDATE tbl_links SET YourField = 1 WHERE ID IN (" & strUpdItems & ")"
set objConn = Server.CreateObject("ADODB.Connection")
objConn.ActiveConnection = YourConnectionString objConn.Open objConn.Execute() objConn.Close Set objConn = Nothing
cya, mrWize
Edited by - mrWize on 03 August 2001 11:20:14 |
 |
|
Freeman II
Junior Member
 
232 Posts |
Posted - 03 August 2001 : 14:08:37
|
ah this is too complicated, ill just use checkbox is there any javascript that prevents people from checking two checkboxes that has the same value?
|
 |
|
Spoon
Average Member
  
Ireland
507 Posts |
Posted - 03 August 2001 : 16:43:56
|
quote:
ah this is too complicated, ill just use checkbox is there any javascript that prevents people from checking two checkboxes that has the same value?
Too complicated?? The only way to learn is to keep at it. To stop them ticking two checkboxes just name the boxes the same, just with different values: Eg.
<input type="checkbox" value="0" name="CHECK_ME_OUT"> <input type="checkbox" value="1" name="CHECK_ME_OUT">
That should work.
Regards - Spoon
Begineer? Need help installing the forums? - www.aslickpage.com/snitz_help.html
www.ASlickPage.com - Private Messaging |
 |
|
|
Topic  |
|