Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > ADO.NET
|
ADO.NET For discussion about ADO.NET.  Topics such as question regarding the System.Data namespace are appropriate.  Questions specific to a particular application should be posted in a forum specific to the application .
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ADO.NET 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 January 14th, 2004, 07:04 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default Copy Data from Access.mdb into an Excel Spreadshee

Dear Users,

I have attached a piece of code which copies an Access Table onto an Excel Spreadsheet. Does anyone know how to ?

1) Get the information to code to skip the first couple of rows then input the information from the Database.

2) How does one copy the information onto a specific spreadsheet; this code opens a new worksheet. But I would like to update an existing worksheet?

**********************************
 Dim cnSrc As New ADODB.Connection()
    Dim TDate As New System.DateTime(2004, 11, 30)
    Dim WKTemp As String

    TDate = Today()
    WKTemp = "Ross" & " " & TDate
    Dim num_Copied As Long

    cnSrc.Open("Provider=Microsoft.Jet.OLEDB.4.0;User ID=Admin;Data Source=C:\DATA\ACCESS\13FloorEquipment.mdb;")

    cnSrc.Execute("SELECT * INTO [Excel 8.0;DATABASE=C:\DATA\ACCESS\13FloorEquipment.xls].[" & WKTemp & "] FROM [Requests]")

     cnSrc.Close()
*******************************
 
Old January 15th, 2004, 06:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 344
Thanks: 0
Thanked 1 Time in 1 Post
Default

check out the code at http://www.greggriffiths.org/webdev/both/excel/ that and the links there should give you a start
 
Old January 23rd, 2004, 10:46 AM
Authorized User
 
Join Date: Jul 2003
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alex_read
Default

You might want to also lookup the CopyFromRecordset method()






Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy of IceCream.mdb dezmond2 BOOK: Beginning Access VBA 2 July 5th, 2007 04:02 PM
Copy data to Excel gjackson Visual Basic 2005 Basics 1 July 1st, 2007 07:56 AM
Copy data from Excel to open HTML form Bartje Excel VBA 1 September 29th, 2006 04:02 AM
Copy data from webpage to excel using vba kg8299 Excel VBA 0 April 5th, 2006 03:51 AM
copy table from one access .mdb to another jimsparks Classic ASP Databases 2 July 26th, 2003 05:22 PM





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