Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 asp help
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Freeman II
Junior Member

232 Posts

Posted - 01 August 2001 :  18:14:52  Show Profile
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  Show Profile
any idea?

Go to Top of Page

RaiderUK
Average Member

United Kingdom
577 Posts

Posted - 03 August 2001 :  04:37:06  Show Profile  Send RaiderUK a Yahoo! Message
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
Go to Top of Page

RaiderUK
Average Member

United Kingdom
577 Posts

Posted - 03 August 2001 :  04:58:01  Show Profile  Send RaiderUK a Yahoo! Message
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

Go to Top of Page

mrWize
deleted

119 Posts

Posted - 03 August 2001 :  11:15:59  Show Profile
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
Go to Top of Page

mrWize
deleted

119 Posts

Posted - 03 August 2001 :  11:19:40  Show Profile
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
Go to Top of Page

Freeman II
Junior Member

232 Posts

Posted - 03 August 2001 :  14:08:37  Show Profile
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?

Go to Top of Page

Spoon
Average Member

Ireland
507 Posts

Posted - 03 August 2001 :  16:43:56  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.68 seconds. Powered By: Snitz Forums 2000 Version 3.4.07