Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2003, 04:51 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access to excel

Hi all,

I have a large access database from which I need to extract specific fields to use in claculations within an Excel VBA program. I have set up the ODBC connection but am unclear about how to express the SQL query within the vba to get the required field. Also would it be quicker to pull out all the information first and then store this in an array or to pull out each piece of data as required in the calculation (assuming no loops)?

I know this could be a biggy but any help is greatly appreciated.

Cheers

Chris
 
Old August 15th, 2003, 05:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Firstly, how much data are you thinking of pulling out of Access? It might be that the simplest option is to use the 'External Data' (MS Query) tool to pull the data onto a sheet and manipulate it from there. Using MS Query will also generate the required SQL code, which you can then either use 'as is' in VBA, or as a template for creating queries on the fly. I'm assuming you are going to be using ADO as the actual access method within VBA.
As far as performance is concerned, the rule of thumb is to pull as much data as you can in one go. This minimises network traffic, and uses the bandwidth more efficiently. Even if you're not on a network, the reduced number of disk reads improves performance.

HTH

Chris

There are two secrets to success in this world:
1. Never tell everything you know
 
Old August 16th, 2003, 03:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

Check out http://www.zmey.1977.ru/Access_To_Excel.htm and http://www.greggriffiths.org/webdev/both/excel/ which should provide you with plenty of information.
 
Old September 3rd, 2003, 08:48 AM
Registered User
 
Join Date: Jun 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry been away thaks both for the help





Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel to Access darkhalf Classic ASP Basics 6 June 18th, 2008 01:43 PM
Excel to Access h@ckerz Access VBA 3 December 18th, 2006 10:32 AM
Excel via Access Vision G Access 2 June 1st, 2006 04:40 AM
Converting excel data to Access using excel VBA ShaileshShinde VB Databases Basics 1 April 26th, 2006 07:57 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.