#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 55
Default Access to Excel

I need to get a table from MS Access into MS Excel in Office 2003, any
suggestions
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,339
Default Access to Excel

try:

In Excel:

Data=Import External Data=Import Data

Select your Access Data base and then required table.

"Josh C" wrote:

I need to get a table from MS Access into MS Excel in Office 2003, any
suggestions

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default Access to Excel

I have a code example on this page that use ADO
http://www.rondebruin.nl/accessexcel.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Toppers" wrote in message ...
try:

In Excel:

Data=Import External Data=Import Data

Select your Access Data base and then required table.

"Josh C" wrote:

I need to get a table from MS Access into MS Excel in Office 2003, any
suggestions

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default Access to Excel

Try this something like this
replace FIELDNAME's and MyTable with your own
also change path to database
Private Sub QueryAccessDB()
Dim cnn As ADODB.Connection
Dim rs1 As ADODB.Recordset
Dim strSQL1 As String, strConn
Dim i As Integer

i = 1

'Use for Access (jet)
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source=C:\PathTo\Database\" _
& "MyDatabaseName.mdb;Persist Security Info=False"

'Use for jet
strSQL1 = "SELECT MyTable.FIELDNAME1, MyTable.FIELDNAME2,
MyTable.FIELDNAME3, " _
& "MyTable.FIELDNAME4, " _
& "FROM MyTable; "


Set cnn = New ADODB.Connection
Set rs1 = New ADODB.Recordset
cnn.Open strConn
rs1.Open strSQL1, cnn, adOpenForwardOnly, adLockReadOnly
Do While rs1.EOF = False
Sheets("Sheet1").Range("A" & i) = rs1!FIELDNAME1
Sheets("Sheet1").Range("B" & i) = rs1!FIELDNAME2
Sheets("Sheet1").Range("C" & i) = rs1!FIELDNAME3
Sheets("Sheet1").Range("D" & i) = rs1!FIELDNAME4
' Sheets("Sheet1").Range("E" & i) = rs1!FIELDNAME5
' Sheets("Sheet1").Range("F" & i) = rs1!FIELDNAME6
' Sheets("Sheet1").Range("G" & i) = rs1!FIELDNAME7
' Sheets("Sheet1").Range("H" & i) = rs1!FIELDNAME8
i = i + 1
rs1.MoveNext
Loop
rs1.Close
cnn.Close
End Sub

"Josh C" wrote:

I need to get a table from MS Access into MS Excel in Office 2003, any
suggestions

Reply
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
excel to access Zygan Excel Discussion (Misc queries) 1 July 18th 06 06:49 PM
Excel To Access ernie Excel Discussion (Misc queries) 0 March 13th 06 01:59 AM
Access Form In An Access Report (SubForm) Question Gary Links and Linking in Excel 0 January 27th 06 05:54 AM
Excel not Access fred New Users to Excel 3 January 18th 06 06:03 PM
export access to excel. change access & update excel at same time fastcar Excel Discussion (Misc queries) 0 June 24th 05 09:27 PM


All times are GMT +1. The time now is 03:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"