Classic ASP - How get Data from Excel and insert into excel


<%
excel_file_name="../EXCEL_MODULE/TRAINEES.XLS"
excel_sheet_name="INPLANT_LIST"
Set fs=Server.CreateObject("scripting.FileSystemObject")
excel_file_name=Server.Mappath(excel_file_name)
response.write(excel_file_name)

    Set MyconnXL=Server.CreateObject("adodb.connection")
    MyconnXL.open "Provider=Microsoft.jet.oledb.4.0;data source=" & excel_file_name & ";Extended Properties=Excel 8.0;"
    Set ObjRsXL=MyconnXL.Execute("select * from ["& excel_sheet_name & "$]")
    If ObjRsXL.eof then
      response.write("no records present in the excel worksheet")
    Else
While Not ObjRsXL.Eof
Err.Clear
trainee_name=ObjRsXL("TRAINEE_NAME")
Response.write("
" & trainee_name)
   ObjRsXL.Movenext
   Wend
    End If
    MyconnXL.close
    Set MyconnXL=nothing

%>

<%

Set MyconnXL=Server.CreateObject("adodb.connection")
MyconnXL.open "Provider=Microsoft.jet.oledb.4.0;data source=" & excel_file_name & ";Extended Properties=Excel 8.0;"
sqlINS="select * from ["& excel_sheet_name & "$]"
Set ObjRsXL=MyconnXL.Execute("select * from ["& excel_sheet_name & "$] where trainee_name='RAMESH'")
set rsINS=server.createobject("adodb.recordset")
rsINS.cursorLocation=3
rsINS.open sqlINS,myconnXL,1,3

rsINS("AGE")=5
RsIns.Update

Set MyconnXL=Nothing
 %>