omarr226
04-14-2006, 05:33 PM
ok now..my topic doesnt seems to be understandable so i'll explain my situation in a more detailed way>>>
i want to insert data which is coming from sqlserver through ahref..
now on my 1st page, lets say, Select.asp i have listed a combo box and wen i select any of da listed values and hit da search button, many records according to da search criteria user has defined, are displayed in da Searched.asp page. Now da question is i dont know how many records will be shown, dey can be 0 or as many as possible. Now wat i want is to include a link "Apply" wid each displayed record. This link is redirected to another page, lets say, Apply.asp and it only stores da id of da displayed record (from Searched.asp) which ofcourse will be coming from database and can be understood as its primary key, in a new table in Apply.asp. Everything is nicely coded, not even a single error, but the problem is dat id of da particular displayed record is not inserting into da database, instead only 0 is being inserted everytime i click any of da "Apply" link.
The data type i have used in da main table from which da records r being shown is bigint and also in da table in whch dat id is going to be inserted.
i have used da following code in Searched.asp
<%Response.Write "<a href=""http://localhost/son/apply.asp?ID=" & rs("jobid")& """>Apply</a>"%>
wid da loop and etc etc..!!
now da Apply.asp>>>
jobno=request.form("jobid")
sql="insert into jobcv(jobid)values('"&jobno&"')"
rsinsert.open sql,con,1,2
Response.write("applied")
'rsinsert.close
1 more thing... wenever i close da rsinsert recordset, error is shown dat
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
now plz help me wats wrong wid da code..!!!
why everytime 0 is inserted and y not da id of da selected record..!!!?????????????????? :eek: :eek: :eek:
i want to insert data which is coming from sqlserver through ahref..
now on my 1st page, lets say, Select.asp i have listed a combo box and wen i select any of da listed values and hit da search button, many records according to da search criteria user has defined, are displayed in da Searched.asp page. Now da question is i dont know how many records will be shown, dey can be 0 or as many as possible. Now wat i want is to include a link "Apply" wid each displayed record. This link is redirected to another page, lets say, Apply.asp and it only stores da id of da displayed record (from Searched.asp) which ofcourse will be coming from database and can be understood as its primary key, in a new table in Apply.asp. Everything is nicely coded, not even a single error, but the problem is dat id of da particular displayed record is not inserting into da database, instead only 0 is being inserted everytime i click any of da "Apply" link.
The data type i have used in da main table from which da records r being shown is bigint and also in da table in whch dat id is going to be inserted.
i have used da following code in Searched.asp
<%Response.Write "<a href=""http://localhost/son/apply.asp?ID=" & rs("jobid")& """>Apply</a>"%>
wid da loop and etc etc..!!
now da Apply.asp>>>
jobno=request.form("jobid")
sql="insert into jobcv(jobid)values('"&jobno&"')"
rsinsert.open sql,con,1,2
Response.write("applied")
'rsinsert.close
1 more thing... wenever i close da rsinsert recordset, error is shown dat
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
now plz help me wats wrong wid da code..!!!
why everytime 0 is inserted and y not da id of da selected record..!!!?????????????????? :eek: :eek: :eek: