Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
"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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
import more than 65000 records into excel | Excel Discussion (Misc queries) | |||
Linking Access Records to Excel | Excel Worksheet Functions | |||
Import Access into Excel | Excel Discussion (Misc queries) | |||
Import Text file into Excel and match up records | Excel Discussion (Misc queries) | |||
Import records from Access to Excel | Excel Discussion (Misc queries) |