Forum Moderators: open

Message Too Old, No Replies

ASP to import data from excel to sql server

is there an easy way?

         

gazraa

11:32 am on Jan 25, 2005 (gmt 0)

10+ Year Member



The idea is have a form on the web page that will let you browse to the excel file with all the data in and the script will go through the spreadsheet and populate the relevant tables in a sql server 2000 db.

I can already see the potential for major headaches if data is wrong, or something else screws up, but it's the way "it's been decided" to do it before I got the task.

First of all.... is that the best option, or would an excel to xml to db method be better?

Second of all, is there a component that will do this?

Third of all, would it be easier to write it in VB as a component to do this?

Fourth of all, why do technical decisions get made before the technical people get involved? :)

(The first 3 questions are more important though)

aspdaddy

12:26 pm on Jan 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1) it depends on the other alternatives, if you havent thought of any then I guess its the best option. It certainly will work

The error handling just needs doing appropriately, its not necessary a big problem.

2) Yes an ADODB.Connection supports excel & sql 2K and Scrpting.Filesystem supports csv & text file reading - both components should be already avilable to you. If the excel files are at the client you may need an additional 3rd party upload component.

3) Yes if you want to hide the implementation from the asp code and yes if the filesize/frequency demand higher performance than a pure script gives.
4) Because they dont distinguish between system requirements,logical design and physical design!

gazraa

1:47 pm on Jan 25, 2005 (gmt 0)

10+ Year Member



right, ok

so, let's say I choose the ADODB.Connection option. Would it pan out like this:

1. Upload file
2. Set up connection to spreadsheet
3. Import data to a temp table
4. do data processing stuff into proper tables
5. either delete or archive spreadsheet
6. job's a goodun

I've been doing asp for a while but haven't used it with ms office at all, so it's a bit new to me

aspdaddy

5:19 pm on Jan 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I would built in some data validation, error handling etc. and personally wouldnt bother with temp tables.