hi,plzz...ignore my previous code...this is the code ...right now ...
i need to check that if name_id is already der or not..if its der ... i need to update otherwise i need to insert....
i get this error.....
Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
Line 1: Incorrect syntax near '1232'---------------> this is the value of useridof this line(oConn.Execute("insert statustable (status,name_id,userid) values ('"&i&"','" &request.form("nameid")&"',"&userid&"")).
/bench_task/responses/hideshow.asp, line 134
<%
id = session("userid")
sSql = "SELECT name,name_id FROM nametable WHERE userID = "&id&""
'set msg=oConn.Execute("insert tbl1 (satus,resid,userid) values ('"&i&"','"&sd(0)&"',"&userid&"")
oRs.Open sSql, oConn
While not oRs.EOF
Response.write("<table cellspacing='1' cellpadding='4' class='rep_tbl'><tr><form method='post' ><td width='10%' align='right'>Name : </td><td width='30%'>"&ors(1)&"</td></tr><td align='right'><input type='hidden' name='nameid' value='"&ors(0)&"' ><input name='submit' type='submit' value='Hide' > <input name='submit' type='submit' value='Show' ></td></form></tr></table>")
oRs.MoveNext()
Wend
if request.form("submit")="Hide" then
i=0
elseif request.form("submit")="Show" then
i=1
end if
set chk1 = oConn.Execute("select name_id from statustable where name_id='" &request.form("nameid")&"'")
if not chk1.eof then
oConn.Execute("UPDATE statustable SET status = '"&i&"',name_id= '" &request.form("nameid")&"' where userID = "&userid&"")
else
oConn.Execute("insert statustable (status,name_id,userid) values ('"&i&"','" &request.form("nameid")&"',"&userid&"")
end if
%>