Results 1 to 2 of 2

Thread: ASP-Excel

  1. #1
    Bhushan P. Madan Guest

    Default ASP-Excel

    Hi,<BR>I called you up today afternoon regarding my doubt.<BR>I need to know how do I read an Excel document which is in table format through ASP & put the data fields in oracle database. My excel document is in the form of certain template which has certain fields which are protected & certain fields which are updatable. I need to read those updatable fields & copy them up in respective oracle table&#039s columns.<BR>Kindly let me know the same soon.<BR><BR>Thanks,<BR>Bhushan..<BR>

  2. #2
    CPeinado Guest

    Default RE: ASP-Excel

    I have done something similar but not to Oracle. SQL Server instead. <BR><BR>To Read the Excel file you must:<BR><BR>- Set up your odbc connection to point to the excel file you want to get your data from.E.g. For our purposes We&#039ll call this connection "ADOExcel". <BR><BR>- Define a Range from which you want to pull the data from in the excel file. E.g. (on office 2000) Highlight the table and click on Insert, Name, Define and enter a Range Name. For our purposes our range will be "Range1". Save and exit the file.<BR><BR>- Then your asp code would look similar to this:<BR><BR>Set objConn = Server.CreateObject("ADODB.Connection")<BR>objConn .Open "ADOExcel" <BR> <BR>Set objRS = Server.CreateObject("ADODB.Recordset")<BR>objRS.Ac tiveConnection = objConn<BR>objRS.Source = "Select * from Range1"<BR>objRS.Open<BR><BR>Note that the first row in your recordset does not have a .value property, instead it has a .name property.<BR>E.g. <BR>First Record:<BR>objRS.Fields(0).name<BR><BR>Rest:<BR>ob jRS.Fields(0).value<BR><BR>Once you have these, I would recomend using an insert stored proc to make it easier for you and just loop through the records inserting them to the Oracle db. <BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts