Duplication Records

Results 1 to 2 of 2

Thread: Duplication Records

  1. #1
    Join Date
    Dec 1969

    Default Duplication Records

    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 vurus comp2<BR>..........<BR><BR>coding is<BR>---------- <BR>stn_no=Request.Form("stn_no")<BR>software=Requ est.Form("software")<BR><BR>for x = 1 to Request.Form("software").Count <BR><BR>ssql="select &#039;"&Request.Form("software").Item(x)&"&#039 ; from software where stn_no=&#039;"& (stn_no) &"&#039;"<BR><BR>next<BR><BR>set rs=cn.Execute(ssql) <BR><BR>if rs.eof=false then <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 software (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>multiple value (software) received from the asp page.<BR><BR>what condition (loop) will apply that if software not exit it should be move to next coding and<BR>insert records and if software exit it not insert duplicate records ?<BR><BR>this condition check only single record, when multiple records <BR>received, it does not work, and insert duplicate records why ?<BR><BR>Please help<BR><BR>Mateen<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default This code doesn't make any sense. ...

    ...What is this supposed to do?<BR><BR>for x = 1 to Request.Form("software").Count <BR>&nbsp;&nbsp;ssql="select &#039;"&Request.Form("software").Item(x)&"&#039 ; from software where stn_no=&#039;"& (stn_no) &"&#039;"<BR>next<BR><BR>set rs=cn.Execute(ssql)<BR><BR>You only execute the SQL statement ONCE, AFTER the FOR loop is finished. Do you mean to execute the SQL INSIDE the FOR loop, or why do you have the FOR loop?<BR><BR>Oliver.

Posting Permissions

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