Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 3rd, 2007, 01:33 AM
Authorized User
 
Join Date: Nov 2007
Location: patna, bihar, India.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sanjeev jha
Default select option and update more rows in table .

hello frainds
where is the not report any error but not update any row and when remove the loop then one one record is updated
can any body help me in updation of rows in asp with vbscript
<select name="vopenflg <%=R("top_id")%>">
        <%If IsEmpty(vopenflg) or vopenflg = 0 Then%>
          <option value=" " selected>Normal</option>
           <option value="0">Abuse</option>
          <option value="1">clsoe</option>
         <%Elseif vopenflg =1 Then%>
          <option value=" " >Normal</option>
          <option value="0" selected>Abuse</option>
          <option value="1">clsoe</option>
          <%Elseif vopenflg =2 Then%>
          <option value=" " >Normal</option>
          <option value="0" >Abuse</option>
          <option value="1" selected>clsoe</option>
          <%End If%>
      </select>
  <% R.close
  If Not IsEmpty(Request.Form("submit")) then
   vopenflg = Request.Form("vopenflg")
    vopenflg=trim(vopenflg)
     conn.close
    conn.Mode = adModeReadWrite
   conn.open
   R.open "select top_id,open_flg from topmaster ",conn, adOpenStatic, adLockOptimistic, adCmdText
   if request.QueryString("vopenflg"& R("top_id"))<>"" then
   R("open_flg")=vopenflg
   R.update
   R.Close
  conn.close
end if
end if
end if
%>
__________________
sanjeev
 
Old November 3rd, 2007, 01:58 AM
Authorized User
 
Join Date: Nov 2004
Location: CHENNAI, TamilNadu, India.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tks_muthu
Default

Hi
plz try this one:
<%
if (request("submit"))<>"" then
  vFlag=Trim(Request("vopneflg"))
  updateStr="UPDATE topmaster set open_flg='"&Trim(vFlag)&"'"
  conn.execute(updateStr)
end if
%>

Muthu
 
Old November 3rd, 2007, 02:42 AM
Authorized User
 
Join Date: Nov 2007
Location: patna, bihar, India.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sanjeev jha
Default

thanks for reply but soryy this is some response is taking if any open_flg is set 0,1, 2 then it remove all value from table but not insert any value which is select 0, 1, 2 plz

sanjeev
 
Old November 6th, 2007, 07:37 AM
Authorized User
 
Join Date: Nov 2007
Location: patna, bihar, India.
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to sanjeev jha
Default

hello this code is update all record from table so how can update only selected rows from table records. i am using pagingnation and show one record on page if more then one record is show on page then multiple oledb error so help plz
[]code] code is here[/code]
 <%conn.close
  If Not IsEmpty(Request.Form("submit")) then
  vopenflg = Request.Form("vopenflg")
  vopenflg=trim(vopenflg)
  conn.Mode = adModeReadWrite
  conn.open
  R1.open "Select open_flg from topmaster ", conn, adOpenStatic, adLockOptimistic, adCmdText
  R1("open_flg")=vopenflg
  do while not R1.eof
  R1.moveNext
  loop
  R1.update
  R1.Close
  conn.close
  end if
%>

sanjeev




Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamically create table rows onChange of select crmpicco Classic ASP Basics 0 August 18th, 2005 07:01 AM
How can I update 2 rows in one column in SQL table babou Classic ASP Databases 6 March 9th, 2005 11:13 AM
Select/Option Problem TSEROOGY Javascript 2 October 4th, 2004 03:32 PM
Getting select option name not value mildge Javascript How-To 2 April 5th, 2004 10:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.