jitendra
07-17-2009, 07:44 AM
Please help me out of this traditional asp code
Its Urgent.................
here is my code as,
<%
'Response.write (Request("cat_id"))
company_profile=request("company_profile")
jobdesc=request("jobdesc")
cand_profile=request("cand_profile")
location=request("location")
compensation=request("compensation")
active=request("active")
date_posted=Request("date")
design=request("design")
set rs = server.createobject("ADODB.Recordset")
sql = "select * from vacancy"
rs.Open sql, conn,adOpenDynamic ,adLockOptimistic
set rs1 = server.createobject("ADODB.Recordset")
sql = "select job_category FROM job_category WHERE Job_cat_id="& Request("cat_id")&""
rs1.Open sql, conn,adOpenDynamic ,adLockOptimistic
if request("mode")="add" then
rs.AddNew
rs("cat_id")=Request("cat_id")
rs("job_cat")=rsl("job_category")
''rs("job_cat")=rs1("job_category")
rs("desig")=Request("design")
rs("company_profile")=Request("company_profile")
rs("jobdesc")=Request("jobdesc")
rs("cand_profile")=Request("cand_profile")
rs("location")=Request("location")
rs("compensation")=Request("compensation")
if request("active")="on" then
rs("active")=1
else
rs("active")=0
end if
rs("date_posted")=Request("date_posted")
rs.Update
rs.movelast
vacancy_id=rs("vacancy_id")
Response.Redirect "VaccancyUpdate.asp?vacancy_id="&vacancy_id &"&cat_id="&request("cat_id")
else
rs.movefirst
rs.find "vacancy_id="&Request("vacancy_id")
vacancy_id=request("vacancy_id")
rs("cat_id")=Request("cat_id")
rs("job_cat")=rsl("job_category")
''rs("job_cat")=rs1("job_category")
rs("desig")=Request("design")
rs("company_profile")=Request("company_profile")
rs("jobdesc")=Request("jobdesc")
rs("cand_profile")=Request("cand_profile")
rs("location")=Request("location")
rs("compensation")=Request("compensation")
if request("active")="on" then
rs("active")=1
else
rs("active")=0
end if
rs("date_posted")=Request("date_posted")
rs.Update
Response.Redirect "VaccancyUpdate.asp?vacancy_id="&vacancy_id &"&cat_id="&request("cat_id")
end if
conn.Close
Response.Redirect "VaccancyUpdate.asp?vacancy_id="&vacancy_id &"&cat_id="&request("cat_id")
%>
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.
Its Urgent.................
here is my code as,
<%
'Response.write (Request("cat_id"))
company_profile=request("company_profile")
jobdesc=request("jobdesc")
cand_profile=request("cand_profile")
location=request("location")
compensation=request("compensation")
active=request("active")
date_posted=Request("date")
design=request("design")
set rs = server.createobject("ADODB.Recordset")
sql = "select * from vacancy"
rs.Open sql, conn,adOpenDynamic ,adLockOptimistic
set rs1 = server.createobject("ADODB.Recordset")
sql = "select job_category FROM job_category WHERE Job_cat_id="& Request("cat_id")&""
rs1.Open sql, conn,adOpenDynamic ,adLockOptimistic
if request("mode")="add" then
rs.AddNew
rs("cat_id")=Request("cat_id")
rs("job_cat")=rsl("job_category")
''rs("job_cat")=rs1("job_category")
rs("desig")=Request("design")
rs("company_profile")=Request("company_profile")
rs("jobdesc")=Request("jobdesc")
rs("cand_profile")=Request("cand_profile")
rs("location")=Request("location")
rs("compensation")=Request("compensation")
if request("active")="on" then
rs("active")=1
else
rs("active")=0
end if
rs("date_posted")=Request("date_posted")
rs.Update
rs.movelast
vacancy_id=rs("vacancy_id")
Response.Redirect "VaccancyUpdate.asp?vacancy_id="&vacancy_id &"&cat_id="&request("cat_id")
else
rs.movefirst
rs.find "vacancy_id="&Request("vacancy_id")
vacancy_id=request("vacancy_id")
rs("cat_id")=Request("cat_id")
rs("job_cat")=rsl("job_category")
''rs("job_cat")=rs1("job_category")
rs("desig")=Request("design")
rs("company_profile")=Request("company_profile")
rs("jobdesc")=Request("jobdesc")
rs("cand_profile")=Request("cand_profile")
rs("location")=Request("location")
rs("compensation")=Request("compensation")
if request("active")="on" then
rs("active")=1
else
rs("active")=0
end if
rs("date_posted")=Request("date_posted")
rs.Update
Response.Redirect "VaccancyUpdate.asp?vacancy_id="&vacancy_id &"&cat_id="&request("cat_id")
end if
conn.Close
Response.Redirect "VaccancyUpdate.asp?vacancy_id="&vacancy_id &"&cat_id="&request("cat_id")
%>
Error Type:
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.