Hi,
I am having two text boxes in a form(ASP) when I entered the value in text box it is passed to excel sheet .I am doing some calculation in excel-2003 for example(A+B=C).I am able to pass text box values to excel but I am unable to retrieve the calculated value from excel to the form.In Excel sheet the result is getting updated.Can anyone Suggest Coding to read updated value from excel to asp.
My Coding:
<%
Dim objConn
Set objConn = Server.CreateObject ("ADODB.Connection")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("") & ";Extended Properties=""Excel 8.0;HDR=NO;""" '&";UID='';PWD=''"
%>
<Form name="FrmFeeStrM">
<tr class="gro">
<TD nowrap COLSPAN="1">Text Box 1 </td>
<td><input name="" type="text" ></td>
</tr>
<tr class="gro">
<TD nowrap COLSPAN="1">Text Box 2 </td>
<td><input name="" type="text" ></td>
</tr>
<tr class="gro">
<th colspan="6" scope="col" align="Center"><input type="button" name="btnSave" id="btnSave" value="Save" OnClick=" return fnsend();" > <input type=reset value=Cancel> </th>
<%
if Trim(Request("btnval"))="1" then
%>
<%
InsBDQry = "UPDATE [Sheet1$A6:A6] SET F1='"&trim(Request("text box name"))&"';"
objconn.execute InsBDQry
InsBDQry = "UPDATE [Sheet1$B6:B6] SET F1='"&trim(Request("text box name"))&"';"
objconn.execute InsBDQry
objconn.close()
End If
%>
<%
if Trim(Request("btnval"))="1" then
%>
<%
Dim objConn1
Set objConn1 = Server.CreateObject ("ADODB.Connection")
objConn1.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("\tadedu\testxl\" &"payroll.xls") & ";Extended Properties=""Excel 8.0;HDR=NO;""" '&";UID='';PWD=''"
Dim strSQL
strSQL = "SELECT * FROM [Sheet1$]"
Dim objRS
Set objRS = Server.CreateObject ("ADODB.RecordSet")
objRS.Open strSQL, objConn1
do while not objRS.EOF
Response.write("<tr><td>"&objRS(0)&"</td>"&"<td>"&objRS(1)&"</td>"&"<td>"&objRS(2)&"</td></tr>")
objRS.Movenext()
Loop
objRS.close()
Set objRS= Nothing
objConn1.close()
Set objConn1=Nothing
End if
%>