Duplication problem
I have data in the software table like this
SOFTWARE STN_NO
------------------------- -------
Microstation windows 98 se comp1
Windows 2000 Professional comp1
Adobe Acrobat 4.0 comp1
Windows xp Comp2
Anti vurus comp2
..........
coding is
----------
stn_no=Request.Form("stn_no")
software=Request.Form("software")
for x = 1 to Request.Form("software").Count
ssql="select '"&Request.Form("software").Item(x)&"' from software where stn_no='"& (stn_no) &"'"
next
set rs=cn.Execute(ssql)
if rs.eof=false then
x=server.URLEncode("Software already exit")
Response.Redirect("inv_update_response3.asp?msg=" & x)
else
for x = 1 to Request.Form("software").Count
sql = "insert into software (software,stn_no) values ("
sql = sql & "'" & Request.Form("software").Item(x) & "','" & stn_no & "')"
cn.Execute sql
next
multiple value (software) received from the asp page.
what condition (loop) will apply that if software not exit it should be move to next coding and
insert records and if software exit it not insert duplicate records ?
this condition check only single record, when multiple records
received, it does not work, and insert duplicate records.
Please help
Mateen
|