Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Apologies: access/excel ado via vba - forgot a line

Hi there

Are the following pieces of code equivalent, especially in terms of
performance? I'm trying to summarize a huge Access database for further
analysis in Excel and need to improve efficiency of data transfer between
the two apps as far as possible ... I'd appreciate any ideas

(1)

strSQL = "SELECT * FROM Customers"
rsData.Open strSQL, cnSrc
Workbooks("C:\book1.xls").Worksheets("Sheet1").Ran ge("A1").CopyFromRecordSet

(2)

strSQL = "SELECT * INTO [Excel 8.0;Database=C:\book1.xls].[Sheet1] FROM
Customers"
cnSrc.Execute strSQL

I can't judge this for myself (yet), since the second procedure isn't
returning any records ... Is this line of enquiry worth pursuing?

Best regards
Loane



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Apologies: access/excel ado via vba - forgot a line

I don't think the line of inquiry is worth pursuing.
Access already have a function for doing that. I've used
it many times.
on the Access menu - ToolsOffice Links analize it with
excel. you can dump queries results and tables into excel.
I have had to download large amounts of data and this
seems fast enough for me. Unless you just want to write
the code, it is not wise to re-invent the wheel when your
appication already has that wheel and in different colors.

-----Original Message-----
Hi there

Are the following pieces of code equivalent, especially

in terms of
performance? I'm trying to summarize a huge Access

database for further
analysis in Excel and need to improve efficiency of data

transfer between
the two apps as far as possible ... I'd appreciate any

ideas

(1)

strSQL = "SELECT * FROM Customers"
rsData.Open strSQL, cnSrc
Workbooks("C:\book1.xls").Worksheets("Sheet1").Ra nge

("A1").CopyFromRecordSet

(2)

strSQL = "SELECT * INTO [Excel 8.0;Database=C:\book1.xls].

[Sheet1] FROM
Customers"
cnSrc.Execute strSQL

I can't judge this for myself (yet), since the second

procedure isn't
returning any records ... Is this line of enquiry worth

pursuing?

Best regards
Loane



.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Apologies: access/excel ado via vba - forgot a line

Hi Frank -
Thanks for this.
I'll let you know what transpires.
Best regards
Loane
"Frank Stone" wrote in message
...
I don't think the line of inquiry is worth pursuing.
Access already have a function for doing that. I've used
it many times.
on the Access menu - ToolsOffice Links analize it with
excel. you can dump queries results and tables into excel.
I have had to download large amounts of data and this
seems fast enough for me. Unless you just want to write
the code, it is not wise to re-invent the wheel when your
appication already has that wheel and in different colors.

-----Original Message-----
Hi there

Are the following pieces of code equivalent, especially

in terms of
performance? I'm trying to summarize a huge Access

database for further
analysis in Excel and need to improve efficiency of data

transfer between
the two apps as far as possible ... I'd appreciate any

ideas

(1)

strSQL = "SELECT * FROM Customers"
rsData.Open strSQL, cnSrc
Workbooks("C:\book1.xls").Worksheets("Sheet1").Ra nge

("A1").CopyFromRecordSet

(2)

strSQL = "SELECT * INTO [Excel 8.0;Database=C:\book1.xls].

[Sheet1] FROM
Customers"
cnSrc.Execute strSQL

I can't judge this for myself (yet), since the second

procedure isn't
returning any records ... Is this line of enquiry worth

pursuing?

Best regards
Loane



.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 593
Default Apologies: access/excel ado via vba - forgot a line

"Frank Stone" wrote ...

SELECT * INTO [Excel 8.0;Database=C:\book1.xls].
[Sheet1] FROM


I don't think the line of inquiry is worth pursuing.
Access already have a function for doing that.


I disagree. A SELECT..INTO query is the most efficient way I know to
export from a Jet .mdb to Excel.

I assume you are alluding to MS Access's TransferSpreadsheet and
similar functionality. These effectively execute sql for you under the
covers e.g. in some circumstances it does a DROP TABLE before an
SELECT..INTO. Maybe it's just me but I prefer to be in control of
executing queries, especially when it is dropping tables!

Also, the MS Access functionality has limitations that can be
circumvented using queries e.g. tale a look at this thread:

http://groups.google.com/groups?thre...ing.google.com

Anyhow, the OP may prefer to control the whole process from Excel. I
assume you are not suggesting they use Excel VBA to automate the MS
Access app in order to use its TransferSpreadsheet (or similar)
functionality, which merely does a SELECT..INTO but under the covers?

Jamie.

--
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
I forgot my password, how do I open a sheet if I forgot the pass Hector Solorzano Excel Worksheet Functions 4 February 20th 13 05:08 AM
Excel 2007 Macro/Link Issue (apologies for cross-posting) MorgSz Links and Linking in Excel 2 July 25th 07 08:12 PM
Apologies for triple post Janev New Users to Excel 2 September 22nd 06 08:56 PM
Apologies Pascal[_3_] Excel Programming 0 July 26th 03 08:49 AM
My Apologies Sisilla Excel Programming 9 July 17th 03 05:54 PM


All times are GMT +1. The time now is 06:08 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"