473,668 Members | 2,611 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Too slow to save a query to excel sheet

awu
All:
I have a query that has 5 fields and around 15500 records. I need to
save it to a excel file that has two sheets. First sheet saves all the
15500 records. Second sheet saves around 7500 records based on 5th
field contents. So there is comparison in the loop. I am using VBA to
execute this operation. The problem I have is the operation is too
slow. It takes more than 5 minutes.

Any other suggestion to save a query to a excel file in a faster
manner?
Thank you
awu10

Nov 8 '06 #1
2 2465

awu wrote:
All:
I have a query that has 5 fields and around 15500 records. I need to
save it to a excel file that has two sheets. First sheet saves all the
15500 records. Second sheet saves around 7500 records based on 5th
field contents. So there is comparison in the loop. I am using VBA to
execute this operation. The problem I have is the operation is too
slow. It takes more than 5 minutes.

Any other suggestion to save a query to a excel file in a faster
manner?
Thank you
awu10
Post the code you're using. If at all possible, use pure SQL to return
the dataset you want to export. Set-at-a-time operations are MUCH
faster than row-at-a-time ones. Sounds like you should create another
query for the second dataset. You can base the second query on the
first and then just use it to do the export.

Nov 8 '06 #2
On 8 Nov 2006 07:06:45 -0800, "awu" <aw***@hotmail. comwrote:

DoCmd.TransferS preadsheet cannot be beaten.
-Tom.

>All:
I have a query that has 5 fields and around 15500 records. I need to
save it to a excel file that has two sheets. First sheet saves all the
15500 records. Second sheet saves around 7500 records based on 5th
field contents. So there is comparison in the loop. I am using VBA to
execute this operation. The problem I have is the operation is too
slow. It takes more than 5 minutes.

Any other suggestion to save a query to a excel file in a faster
manner?
Thank you
awu10
Nov 9 '06 #3

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

Similar topics

1
8780
by: Jawahar Rajan | last post by:
All, I am using the ASP code below to save some data from a SQL Server database via ADO as an Excel spreadsheet strReportName = Request.QueryString("ReportName") If len(strReportName) > 0 then stResultsSql = Session.Contents("sSQL") Set objComm = CreateObject("ADODB.Command")
0
41169
by: I Decker | last post by:
Hi all, Hope this is the right group. I am writing a program in c# to open create an excel document, enter some data, save it and then email it as an attachment. I have successfully created an excel document which the user can see (at this stage of development) and passed some data to it. I then used the savas method to save the file. Again this seems to work as the file is created. However once I close the excel file and try and...
1
3541
by: lldavid | last post by:
Hi, Can you kindly provide me sample VB codes to save a data into one single excel file with data in Sheet 1 and Sheet 2? All i was able to do is save data in Excel Sheet 1. Thanks for the big help. LLD
0
1721
by: rajeshkothuru | last post by:
Hi I am new to perl programming, i stcked at one line. I have written code such that new excel sheet will save accordingly even though if already existed Excel sheet persists. The problem is if my new excel sheet has more number of sheets/charts it is not saving properly and it is getting handle to the already existed Excel sheet. If my new excel sheet has only 1 sheet in side it is saving properly. my $Excel =...
0
2251
by: Vader | last post by:
I am new to this forum. Thanks in advance for and help. The following is what I am looking for: 1. I need help with VB code to open a MS Word (.doc) file. 2. Read lines from the MS Word (.doc) file 3. Save the specific/parsed data on one of the sheets in MS Excel spread sheet. 4. Close up the MS Word (.doc) file. The VB part is based on the MS Excel spreadsheet file . One of the sheet on spreedsheet will have the path name and file...
3
3592
by: Richard Hollenbeck | last post by:
I hope this isn't too confusing. The following query runs pretty fast by itself, but when I want to use it in a report (pasted below the query), it takes at least fifteen seconds to run! Then I want to analyze the query in Excel and I have to do some manual tweaking. I'd like to run this same query as a summary for the whole class without having to manually do it in Excel, rather in an Access report, but that gets even more complicated....
1
3144
by: BLavanya | last post by:
I want to Open an excel sheet , then I want to loop through the rows in the excel sheet and should execute an update query for all the rows where the where condition in the query should match the columns of the excel sheet. Eg: Update Employee set Dept= ‘AAA’ where employeenumbers= Excelsheet firstcolumn So I want to loop this query for all the rows in the excel data. The excel sheet will contain only employee numbers as the first column...
2
1962
by: lindabaldwin | last post by:
Hello everyone, I am fairly new to VBA. I have a worksheet in Excel, named "Data Sheet" from which I am trying to query data. This worksheet contains the following data: unit (column A), date (column B), time range (column C), day of the week (column D), event (column E), and occurrences (column F). I want to be able to identify records that meet user set criteria. I then want to add the number in column F to another number in a different...
1
5587
by: CoreyReynolds | last post by:
I can't find any information on this. If I have an existing query and I want to dump it into a page on a spread sheet and modify it as a pivot table all in VBA, can I do that? I only have the code so far (that works) to dump in the data and create a chart based off it... except I have to manually alter the data I dumped in into a pivot table for the chart to make sense every time.... it sure would be nice if VBA would do it for me! Heres...
0
8462
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8799
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8586
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7401
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6209
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5681
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4205
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2026
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.