condition (loop) problem

Results 1 to 2 of 2

Thread: condition (loop) problem

  1. #1
    Join Date
    Dec 1969

    Default condition (loop) problem

    I have data in the software table like this<BR><BR>SOFTWARE STN_NO<BR>---------------------- -------------<BR>Microstation windows 98 se comp1<BR>Windows 2000 Professional comp1<BR>Adobe Acrobat 4.0 comp1<BR>windows xp comp2<BR>anti virus comp3<BR>..........<BR>and so on<BR><BR>following coding away give message that "software already exit"<BR>what condition (loop) will apply that if software not exit it should be move to next coding and<BR>insert records.<BR><BR>multiple value (software) received from the asp page.<BR>i am using server server.<BR><BR>stn_no=Request.Form("stn_no")<BR>so ftware=Request.Form("software")<BR><BR><BR>for x = 1 to Request.Form("software").Count <BR><BR>ssql="select &#039;"&Request.Form("software").Item(x)&"&#039 ; from software2 where stn_no=&#039;"& (stn_no) &"&#039;"<BR><BR>next<BR><BR>set rs=cn.Execute(ssql)<BR><BR>if rs.eof=false then // here is problem<BR><BR>x=server.URLEncode("Software already exit")<BR><BR>Response.Redirect("inv_update_respon se3.asp?msg=" & x)<BR><BR>else<BR><BR>for x = 1 to Request.Form("software").Count<BR><BR> sql = "insert into software2 (software,stn_no) values ("<BR> sql = sql & "&#039;" & Request.Form("software").Item(x) & "&#039;,&#039;" & stn_no & "&#039;)"<BR><BR> cn.Execute sql<BR>next<BR><BR><BR>Please help<BR><BR>Mateen<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: condition (loop) problem

    you just asked this on didn&#039;t you?<BR><BR>btw why the loop to build the SQL statements? you only end uip selecting the last item in the loop. it&#039;s pointless as far as I can make out.<BR><BR>j<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts