Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default How to make fetching and displaying of data from dtabase to workbook faster??

I have a small querry:-

I need to get data from the database and display in the excel sheet .
The user might ask for 2 yrs data or some times even more ..therz a
form he fills based on which I querry the database.. I want the
fetching and displaying to take minimal time...

I wanted to know of this two approaches which would be faster...

1. Make a temporary array and while moving through the Recordset data
in the do while loop copy these values into the into this temporary
array . And then later copy the values from this array to the
workbook.. Advantage( I need to only change the display procedure if
client wants te data to be displayed in other format ... need not
meddle with the procedure which fetches the data.. But found this takes
a lot of time...) and array would be a 2 dimensional matrix..

2. Instead of making a temporary array , while looping through the
recordset copy the recordset data into the workbook at the same instant
instaed of copying into temp array and then cal a procedure to copy
this array to the workbook ... Will this approach be faster than the
one mentioned above .. I want it to take less time for dispalying and
fetching.... Plz letme know which is a better approach ..

Kindly let me know any functions or properties like turning the display
alerts to false that can be used for faster execution...


Cheers !!!
Divya..

  #2   Report Post  
Posted to microsoft.public.excel.programming
Jay Jay is offline
external usenet poster
 
Posts: 671
Default How to make fetching and displaying of data from dtabase to workbo

Hi Divya -

Suggestion: Before setting out on VBA code to do the job, check the Data
menu in Excel. There is an option there that may help -- 'Import External
Data'. You can point directly to a table or existing query in your external
source (like Access) and the data imports at lightning speed.

If that doesn't apply to your application, the second programmatic option
that you describe is generally much faster in execution than the first. I'd
pursue that approach if necessary.
--
Jay


"divya" wrote:

I have a small querry:-

I need to get data from the database and display in the excel sheet .
The user might ask for 2 yrs data or some times even more ..therz a
form he fills based on which I querry the database.. I want the
fetching and displaying to take minimal time...

I wanted to know of this two approaches which would be faster...

1. Make a temporary array and while moving through the Recordset data
in the do while loop copy these values into the into this temporary
array . And then later copy the values from this array to the
workbook.. Advantage( I need to only change the display procedure if
client wants te data to be displayed in other format ... need not
meddle with the procedure which fetches the data.. But found this takes
a lot of time...) and array would be a 2 dimensional matrix..

2. Instead of making a temporary array , while looping through the
recordset copy the recordset data into the workbook at the same instant
instaed of copying into temp array and then cal a procedure to copy
this array to the workbook ... Will this approach be faster than the
one mentioned above .. I want it to take less time for dispalying and
fetching.... Plz letme know which is a better approach ..

Kindly let me know any functions or properties like turning the display
alerts to false that can be used for faster execution...


Cheers !!!
Divya..


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default How to make fetching and displaying of data from dtabase to workbo

Thanx a Lot Jay for giving the idea of using the "Import External Data"
from the data menu.. It actually imports at lightning speed ... I hav
recorded a macro and recorded the
VB code which does this .. Now based on the the user's input in the
form I will make a query and replace it with the one I used while
recording ... I hope its tht easy ... But if tht doesn't work I will
manually copy records using the second method as u said its faster...
Once again thanx a ton Jay...

Cheers !!!
Divya...
Jay wrote:
Hi Divya -

Suggestion: Before setting out on VBA code to do the job, check the Data
menu in Excel. There is an option there that may help -- 'Import External
Data'. You can point directly to a table or existing query in your external
source (like Access) and the data imports at lightning speed.

If that doesn't apply to your application, the second programmatic option
that you describe is generally much faster in execution than the first. I'd
pursue that approach if necessary.
--
Jay


"divya" wrote:

I have a small querry:-

I need to get data from the database and display in the excel sheet .
The user might ask for 2 yrs data or some times even more ..therz a
form he fills based on which I querry the database.. I want the
fetching and displaying to take minimal time...

I wanted to know of this two approaches which would be faster...

1. Make a temporary array and while moving through the Recordset data
in the do while loop copy these values into the into this temporary
array . And then later copy the values from this array to the
workbook.. Advantage( I need to only change the display procedure if
client wants te data to be displayed in other format ... need not
meddle with the procedure which fetches the data.. But found this takes
a lot of time...) and array would be a 2 dimensional matrix..

2. Instead of making a temporary array , while looping through the
recordset copy the recordset data into the workbook at the same instant
instaed of copying into temp array and then cal a procedure to copy
this array to the workbook ... Will this approach be faster than the
one mentioned above .. I want it to take less time for dispalying and
fetching.... Plz letme know which is a better approach ..

Kindly let me know any functions or properties like turning the display
alerts to false that can be used for faster execution...


Cheers !!!
Divya..



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
can you make this faster? John Excel Programming 2 October 25th 05 08:20 PM
How Can I make excel go faster Jason Zischke Excel Programming 8 March 23rd 05 03:55 PM
make my vba/excel program faster David Lee Excel Programming 0 May 18th 04 06:17 PM
make my vba/excel program faster pikus Excel Programming 0 May 18th 04 04:44 PM
make my VBA program faster Neil[_14_] Excel Programming 2 May 18th 04 04:15 PM


All times are GMT +1. The time now is 10:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"