473,769 Members | 7,315 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Export DS to Excel

It looks like this is a very popular subject, but all the previous messages
have been deleated from the server. In my application, I need to export a
table in my MSAccess database to an Excel 2003 spreadsheet. I have no
trouble with individual ranges, but am having trouble finding a good example
where the data from an entire table is written to the worksheet.

Thanks in advance for any suggestions.

David

Nov 21 '05 #1
3 1650
David,

Why don't you ask it in the newsgroup

microsoft.publi c.excel.program mer

And than direct from Access to VBA.

Kelly wrote once a sample from dataset to xls,
I have the idea that the sample has some overhead, however it works.

http://www.kjmsolutions.com/datasetarray.htm

I hope this helps,

Cor
Nov 21 '05 #2
On Mon, 12 Sep 2005 17:51:42 -0500, "David" <dm*******@hotm ail.com> wrote:

¤ It looks like this is a very popular subject, but all the previous messages
¤ have been deleated from the server. In my application, I need to export a
¤ table in my MSAccess database to an Excel 2003 spreadsheet. I have no
¤ trouble with individual ranges, but am having trouble finding a good example
¤ where the data from an entire table is written to the worksheet.
¤

See if the following works for you:

Dim AccessConn As New System.Data.Ole Db.OleDbConnect ion("Provider=M icrosoft.Jet.OL EDB.4.0;"
& _
"Data Source=e:\My Documents\db1.m db")

AccessConn.Open ()

'New sheet in Workbook
Dim AccessCommand As New System.Data.Ole Db.OleDbCommand ("SELECT * INTO [Excel
8.0;DATABASE=e: \My Documents\Book1 1.xls;HDR=NO;].[Sheet7] from [Table7]", AccessConn)

AccessCommand.E xecuteNonQuery( )
AccessConn.Clos e()
Paul
~~~~
Microsoft MVP (Visual Basic)
Nov 21 '05 #3
There is a wonderful free library at
http://www.carlosag.net/Tools/ExcelX...r/Default.aspx for doing this
kind of thing. Carlos also has a code generator that will reverse-engineer
the styles of a finished workbook, and yuo can integrate your data code
with. Very nice stuff.

"David" <dm*******@hotm ail.com> wrote in message
news:eo******** ********@TK2MSF TNGP14.phx.gbl. ..
It looks like this is a very popular subject, but all the previous messages have been deleated from the server. In my application, I need to export a
table in my MSAccess database to an Excel 2003 spreadsheet. I have no
trouble with individual ranges, but am having trouble finding a good example where the data from an entire table is written to the worksheet.

Thanks in advance for any suggestions.

David

Nov 21 '05 #4

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

Similar topics

1
5035
by: Matt | last post by:
I have an ASP page that calls ASP routines that I created that execute a database query and return the results to a recordset. I then iterate through the recordset and display the data in a table. Before I iterate through the recordset I instruct the browser that the content type is Excel using the following line: (Response.ContentType = "application/vnd.ms-excel") This works fine with Excel 2003 but with older versions (I tested Excel...
13
13241
by: Hemant Sipahimalani | last post by:
The following piece of code is being used to export HTML to excel. HttpContext.Current.Response.ContentType = "application/vnd.ms-excel" HttpContext.Current.Response.AddHeader("content-disposition", "attachment;filename=ABC.xls") HttpContext.Current.Response.Write(strHTML) HttpContext.Current.Response.End() However when the user tries to save it the Default File Type is Web Page(*.htm; *.html)
2
6414
hemantbasva
by: hemantbasva | last post by:
Note We need to have a template on server for generating report in multiple sheet as we do not had msoffice on server moreover this require a batch job to delete excel file created by the method.... it creates 6 sheets # region Namespaces using System;
4
3538
ammoos
by: ammoos | last post by:
Hi Friends, I need to read data from an excel sheet. I am keeping this excel sheet in a remote machine. I am using OLEDB connection to read the data from this excel sheet. But when I am trying to read the data, then I am getting the error message “It is already opened exclusively by another user, or you need permission to view its data.” I am sure the file is not opened by another user. Then may I know what I have to do for getting permission...
1
2335
by: chandhseke | last post by:
Hi folks, I am a newbie to this functionality of creating excel report using VB/VB Script. I have been given a code and asked to add filters to the excel sheet that is created using the below code. Can somebody help me out in resloving the issue?? Thanks in advance.
0
9589
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
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10219
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9998
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
9865
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
8876
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
7413
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
6675
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();...
1
3967
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.