473,386 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Importing millions of records from Database to Excel sheet

Hi
Can some body suggest me which approach I should follow to import
millions of records from data base into an excel sheet?
I am working with ver. 2000 of MS-Excel . The requirement is to
dynamically load 65,000 rows to one excel-grid(worksheet) ,then create
and load the other grids(worksheets) till the data has been loaded
fully.
How can I do this using the Filestream object ,in a very short span of
time like some seconds?
Here, coding is not a problem .I am unable to get things done in a
small time limit hence Performance is the issue.

Thanks for you patience

Feb 6 '07 #1
8 4577
wow ... 1 million records in Excel...

for what purpose are you loading this type of data into Excel? DataTransfer
/ DataAnalysis / Cause you want to build a huge excel file???

maybe you can do it with more logical work chunks? But a million records...

You will have to manually code the copy / insertion of these records into
excel ... ie retrieve 64000 records ... write 'em ... retrieve 64000 records
.... write 'em ... and so on... OLE Excel or ODBC connection to excel come to
mind... I bet you will need a lot of system resources ... i have never
tried it, but when working with Excel and 'large' datasets (small in
comparison to your requirements) i know excel starts to lag a bit.

but to be honest, i doubt there is a quick way to load 1 million records in
to Excel!

Jeff.

"hyper-sensitive" <12**********@gmail.comwrote in message
news:11*********************@q2g2000cwa.googlegrou ps.com...
Hi
Can some body suggest me which approach I should follow to import
millions of records from data base into an excel sheet?
I am working with ver. 2000 of MS-Excel . The requirement is to
dynamically load 65,000 rows to one excel-grid(worksheet) ,then create
and load the other grids(worksheets) till the data has been loaded
fully.
How can I do this using the Filestream object ,in a very short span of
time like some seconds?
Here, coding is not a problem .I am unable to get things done in a
small time limit hence Performance is the issue.

Thanks for you patience

Feb 6 '07 #2
You want to load millions of records into an Excel spreadsheet and you think
this is going to happen in 'some seconds'?

I think you should quantify 'some' but keep it realistic. Just try a test
for yourself. Use some copy and paste to create a very large spreadsheet.
Keep in mind that Excel DOES have a limit to spread sheet size. If I am not
mistaking this is 256 cols by 65535 rows.

The save it as a CSV file and then try to open it again in Excel and see how
fast that is.

No, this is not an answer to your question but it may help you quantify just
how realistic your goal is.

"hyper-sensitive" <12**********@gmail.comwrote in message
news:11*********************@q2g2000cwa.googlegrou ps.com...
Hi
Can some body suggest me which approach I should follow to import
millions of records from data base into an excel sheet?
I am working with ver. 2000 of MS-Excel . The requirement is to
dynamically load 65,000 rows to one excel-grid(worksheet) ,then create
and load the other grids(worksheets) till the data has been loaded
fully.
How can I do this using the Filestream object ,in a very short span of
time like some seconds?
Here, coding is not a problem .I am unable to get things done in a
small time limit hence Performance is the issue.

Thanks for you patience

Feb 6 '07 #3
Forget performance using Excel as an out of process object. To get any
descent performance loading Excel files, you need to actually write your
code as an Excel add-in, and even then, it's going to be slow, but still an
order of magnatude faster than referencing Excel from VB.

Mike Ober.

"hyper-sensitive" <12**********@gmail.comwrote in message
news:11*********************@q2g2000cwa.googlegrou ps.com...
Hi
Can some body suggest me which approach I should follow to import
millions of records from data base into an excel sheet?
I am working with ver. 2000 of MS-Excel . The requirement is to
dynamically load 65,000 rows to one excel-grid(worksheet) ,then create
and load the other grids(worksheets) till the data has been loaded
fully.
How can I do this using the Filestream object ,in a very short span of
time like some seconds?
Here, coding is not a problem .I am unable to get things done in a
small time limit hence Performance is the issue.

Thanks for you patience


Feb 6 '07 #4
"Michael D. Ober" <obermd.@.alum.mit.edu.no.spamwrote in message
news:Sb*******************@newsread3.news.pas.eart hlink.net...
Forget performance using Excel as an out of process object. To get any
descent performance loading Excel files, you need to actually write your
code as an Excel add-in, and even then, it's going to be slow, but still
an order of magnatude faster than referencing Excel from VB.
Here's the method I use if you want to test it's speed against other
methods...

'Create a new workbook in Excel
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
oExcel = CreateObject("Excel.Application")
oBook = oExcel.Workbooks.Add
oSheet = oBook.Worksheets(1)

'Create a recordset (rs) with all the data
'you need using your favourite method.
'Then...

'Copy the whole recordset with one line
oSheet.Range("A1").CopyFromRecordset(rs)

Cheers.
Feb 6 '07 #5
If you want it in seconds and want to preserve excel's functionality
(ie no csv files) then I would say you should use Excel's XML support.
Maybe use a filestream to create the XML file in the appropriate
format and use Process.Start() to open it for the user. Thats probably
as close as you'll get to seconds.

Thanks,

Seth Rowe
On Feb 5, 11:23 pm, "hyper-sensitive" <123imemys...@gmail.comwrote:
Hi
Can some body suggest me which approach I should follow to import
millions of records from data base into an excel sheet?
I am working with ver. 2000 of MS-Excel . The requirement is to
dynamically load 65,000 rows to one excel-grid(worksheet) ,then create
and load the other grids(worksheets) till the data has been loaded
fully.
How can I do this using the Filestream object ,in a very short span of
time like some seconds?
Here, coding is not a problem .I am unable to get things done in a
small time limit hence Performance is the issue.

Thanks for you patience

Feb 6 '07 #6
hyper-sensitive schreef:
Hi
Can some body suggest me which approach I should follow to import
millions of records from data base into an excel sheet?
I am working with ver. 2000 of MS-Excel . The requirement is to
dynamically load 65,000 rows to one excel-grid(worksheet) ,then create
and load the other grids(worksheets) till the data has been loaded
fully.
How can I do this using the Filestream object ,in a very short span of
time like some seconds?
Here, coding is not a problem .I am unable to get things done in a
small time limit hence Performance is the issue.

Thanks for you patience
Millions of records? Why don't you just dump it to an access database?
That was designed for database use.
Feb 6 '07 #7
I would say dump to Access if anything. Do you know what kind of headaches
it will be loading 1M records to excel? You can count in minutes, not
seconds... And lots of minutes!!!

"hyper-sensitive" <12**********@gmail.comwrote in message
news:11*********************@q2g2000cwa.googlegrou ps.com...
Hi
Can some body suggest me which approach I should follow to import
millions of records from data base into an excel sheet?
I am working with ver. 2000 of MS-Excel . The requirement is to
dynamically load 65,000 rows to one excel-grid(worksheet) ,then create
and load the other grids(worksheets) till the data has been loaded
fully.
How can I do this using the Filestream object ,in a very short span of
time like some seconds?
Here, coding is not a problem .I am unable to get things done in a
small time limit hence Performance is the issue.

Thanks for you patience

Feb 6 '07 #8
yeah no mother fucking shit

shove excel up your ass and spit on anyone that uses it.
Excel isnt' a reporting tool.

STFU and tell your stupid fat lazy manager to learn Crystal Reports.

-Aaron

Feb 7 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Edward S | last post by:
I budget for a Project in an Excel sheet as illustrated below. The months below are usually a 2 year period i.e. 24 months, though it could be over 24 months depending upon a Project. I then...
2
by: Mr. Bungle | last post by:
When importing excel from access I am fully aware that one can import directly into a table. Can you get as specific via code or something to import data from an excel sheet to a FORM (Not Table)...
7
by: Bonnie R | last post by:
Hello! I am writing VBA code in Access 97 to import an Excel 2000 Spreadsheet. I had hoped to do this using ODBC, but that was not to be, for who knows what reason. The problem is that I import...
7
by: Darren | last post by:
I have been attempting to create a reservation planning form in excel that imports Data from an Access database and inserts that information automaticly into the correct spreed sheet and the...
9
by: jillandgordon | last post by:
I am trying to import an excel file into Access 97. It looks perfectly all right but, every time I try to import it, I get to the lst step and am told that it was not imported due to an error. ...
1
by: Vivek | last post by:
Hi all, I am trying to import data from an excel sheet to MSSQL server 2000 using a web application (C#). Since I have to validate the data in the excel sheet, the approach i have used is to get...
1
by: Charlotte | last post by:
Hallo, Graag hulp, want ik heb zelf geen oplossing Al gegoogeld, doch zonder concreet resultaat Op onze webserver (intranet) hebben we een website draaien Een bepaalde ASP-pagina haalt zijn...
2
anoble1
by: anoble1 | last post by:
I have a button in my database that when you hit tit, it imports just 1 excel sheet and puts it in a table. Works great. I am wanting to grab 4 more excel sheets from different locations and store...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.