thanks for your reponse.
it is working.
I have another condition problem.
I have data in the software table like this
stn_no software
--------- ---------
comp1 windows 95
comp1 windows 98
comp1 adobe acrobat
comp2 windows 95
comp2 windows 98
comp2 windows 2000
comp2 windows xp
â¦â¦â¦â¦â¦.
coding is
----------
<%
stn_no=Request.Form("stn_no")
software=Request.Form("software")
for x = 1 to Request.Form("software").Count
ssql="select software from software2 where stn_no='"&(stn_no)&"' and software='"& Request.Form("software").Item(x) &"'"
next
set rs=cn.Execute(ssql)
if Not rs.EOF Then
x=server.URLEncode("Software already Installed")
Response.Redirect("inv_update_response3.asp?msg=" & x)
else
for x = 1 to Request.Form("software").Count
sql = "insert into software2 (software,stn_no) values ("
sql = sql & "'" & Request.Form("software").Item(x) & "','" & stn_no & "')"
cn.Execute sql
next
end if
%>
multiple software received from the asp page.
what condition (loop) will apply that if software exit in stn_no it should redirect the page with the message
that "software already installed"
if software not found in stn_no it insert records, but it should not insert duplicate records.
this condition check only single record, when multiple records
received, it does not work, and insert duplicate records, why ?
Mateen
Quote:
quote:Originally posted by planoie
Any time you execute a query that may return no rows (which is usually all of them) check for the EOF flag....
rs = conn.Execute(sSql)
If Not rs.EOF Then
'Rows found, do what you need with the rows.
Else
'No Rows found, handle it.
End If
Peter
------------------------------------------------------
Work smarter, not harder.
|