Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Access to Excel
I need to get a table from MS Access into MS Excel in Office 2003, any
suggestions |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel to access | Excel Discussion (Misc queries) | |||
Excel To Access | Excel Discussion (Misc queries) | |||
Access Form In An Access Report (SubForm) Question | Links and Linking in Excel | |||
Excel not Access | New Users to Excel | |||
export access to excel. change access & update excel at same time | Excel Discussion (Misc queries) |