LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 389
Default Import Access records into Excel

"select * from " & tablename

--
Tim Zych
SF, CA

"dksaluki" wrote in message
...
The code below seems to be the usual code block in order to import
Access records from a particular table into an Excel worksheet, but it
involves a filter, which I do NOT want. I can get it to run just
fine, but I'm having trouble finding how to do it WITHOUT a filter.
Any ideas of how to import everything from Access table to Excel?


With rs
' open the recordset
.Open TableName, cn, adOpenStatic, adLockOptimistic,
adCmdTable
' all records
'.Open "SELECT * FROM " & TableName & _
" WHERE [FieldName] = 'MyCriteria'", cn, , , adCmdText
' filter records

RS2WS rs, TargetRange ' write data from the recordset to the
worksheet

' ' optional approach for Excel 2000 or later (RS2WS is not
necessary)
' For intColIndex = 0 To rs.Fields.Count - 1 ' the field names
' TargetRange.Offset(0, intColIndex).Value =
rs.Fields(intColIndex).Name
' Next
' TargetRange.Offset(1, 0).CopyFromRecordset rs ' the recordset
data

End With



 
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
import more than 65000 records into excel mmatz Excel Discussion (Misc queries) 6 December 13th 06 04:44 PM
Linking Access Records to Excel MayraEllen Excel Worksheet Functions 0 August 21st 06 07:37 PM
Import Access into Excel bcman Excel Discussion (Misc queries) 0 April 12th 06 05:58 PM
Import Text file into Excel and match up records Spanarkle Excel Discussion (Misc queries) 2 April 6th 06 07:34 PM
Import records from Access to Excel Mark Excel Discussion (Misc queries) 1 December 20th 05 01:43 PM


All times are GMT +1. The time now is 12:33 AM.

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"