Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   ASP General (http://www.velocityreviews.com/forums/f65-asp-general.html)
-   -   User Data Import Routine (http://www.velocityreviews.com/forums/t800349-user-data-import-routine.html)

Simon Harris 01-03-2006 08:48 PM

User Data Import Routine
 
Hi All,

I need to write an ASP page that will allow users to upload an Excel file,
the contents of which should then be imported into an SQL database.

Problem I am facing is how to do this efficiently. So far I have a page
that
will accept an upload, then display the data from the Excel file, my first
thought was to loop each row, then run an update/insert based on the data
found...Obviously this is not going to be very efficient, I'd exepect time
outs often!

Has anyone got any ideas to get round this? I'm not looking for a
solution,
just ideas!

Thanks!
Simon.


----------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 3052 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!



Bob Barrows [MVP] 01-03-2006 09:08 PM

Re: User Data Import Routine
 
Simon Harris wrote:
> Hi All,
>
> I need to write an ASP page that will allow users to upload an Excel
> file, the contents of which should then be imported into an SQL
> database.
> Problem I am facing is how to do this efficiently. So far I have a
> page that
> will accept an upload, then display the data from the Excel file, my
> first thought was to loop each row, then run an update/insert based
> on the data found...Obviously this is not going to be very efficient,
> I'd exepect time outs often!
>
> Has anyone got any ideas to get round this? I'm not looking for a
> solution,
> just ideas!
>

Third-party tool:
http://www.aspfaq.com/show.asp?id=2189
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Simon Harris 01-03-2006 09:43 PM

Re: User Data Import Routine
 
> Third-party tool:
> http://www.aspfaq.com/show.asp?id=2189


Thanks Bob, but as mentioned I've done the upload bit...

"So far I have a page that will accept an upload, then display the data
from
the Excel file...."

Problem is how to update/add many rows in the SQL database, based on what
the user enters into the uploaded Spreadsheet....efficiently.

Simon.


----------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 3052 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!



Simon Harris 01-03-2006 09:43 PM

Re: User Data Import Routine
 
> Third-party tool:
> http://www.aspfaq.com/show.asp?id=2189


Thanks Bob, but as mentioned I've done the upload bit...

"So far I have a page that will accept an upload, then display the data
from
the Excel file...."

Problem is how to update/add many rows in the SQL database, based on what
the user enters into the uploaded Spreadsheet....efficiently.

Simon.


----------------------------------------
I am using the free version of SPAMfighter for private users.
It has removed 3052 spam emails to date.
Paying users do not have this message in their emails.
Try www.SPAMfighter.com for free now!




Bob Barrows [MVP] 01-03-2006 10:12 PM

Re: User Data Import Routine
 
Simon Harris wrote:
>> Third-party tool:
>> http://www.aspfaq.com/show.asp?id=2189

>
> Thanks Bob, but as mentioned I've done the upload bit...


Several of these tools include the capability to add the spreadsheets to the
database ...

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



pbagar@gmail.com 01-03-2006 10:20 PM

Re: User Data Import Routine
 
Assuming you have at least the Excel ODBC drivers installed on the
server, you should be able to do something like this. You may have to
add a column list depending on the format of the table/spreadsheet, and
modify the syntax to suit your needs.

sql = "INSERT " & _
" INTO <your table name> " & _
"SELECT * " & _
" FROM [" & <the name of the sheet or range to import> & "$]
" & _
" IN '' [EXCEL 5.0;DATABASE=" & <fully qualifed name of
the excel workbook> & "]"

then hand this off to the DB.

HTH,

Paul

Simon Harris wrote:
> > Third-party tool:
> > http://www.aspfaq.com/show.asp?id=2189

>
> Thanks Bob, but as mentioned I've done the upload bit...
>
> "So far I have a page that will accept an upload, then display the data
> from
> the Excel file...."
>
> Problem is how to update/add many rows in the SQL database, based on what
> the user enters into the uploaded Spreadsheet....efficiently.
>
> Simon.
>
>
> ----------------------------------------
> I am using the free version of SPAMfighter for private users.
> It has removed 3052 spam emails to date.
> Paying users do not have this message in their emails.
> Try www.SPAMfighter.com for free now!



Bob Barrows [MVP] 01-06-2006 08:42 PM

Re: User Data Import Routine
 
Simon Harris wrote:
>> Third-party tool:
>> http://www.aspfaq.com/show.asp?id=2189

>
> Thanks Bob, but as mentioned I've done the upload bit...
>
> "So far I have a page that will accept an upload, then display the
> data from
> the Excel file...."
>
> Problem is how to update/add many rows in the SQL database, based on
> what the user enters into the uploaded Spreadsheet....efficiently.
>

Oh! I thought you wanted to enter the spreadsheet into an image column in
the database table!
Would it be possible to use a scheduled DTS package? If not, see Paul's
post.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.




All times are GMT. The time now is 01:37 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57