LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Import Data From Access! Please Help!!


Got it to work, if anyone was interested here is the code


Code:
--------------------
NewFN1 = lblFile2.Caption

Sheets("DB_Import").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=MS Access Database;DBQ=" & NewFN1 & ";DefaultDir=" & Path_New & ";DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;" _
, Destination:=Range("A1"))
.CommandText = Array( _
"SELECT HouseholdData.Address, HouseholdData.HouseholdDataID, HouseholdData.SurveyDataID, HouseholdData.DeveloperDataID, HouseholdData.CityDataID" & Chr(13) & "" & Chr(10) & "FROM HouseholdData HouseholdData" _
)
.Name = "Query from MS Access Database"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
End With
--------------------


--
greenfalcon
------------------------------------------------------------------------
greenfalcon's Profile: http://www.excelforum.com/member.php...o&userid=13622
View this thread: http://www.excelforum.com/showthread...hreadid=560025

 
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 Data from Access toby131 Excel Discussion (Misc queries) 3 October 27th 09 11:47 PM
Can't import data to access Amin Excel Discussion (Misc queries) 3 September 26th 08 04:56 AM
Dynamic Data Import From Access Achilleas Charts and Charting in Excel 1 February 19th 07 07:26 PM
data import and export in to access nuti Excel Discussion (Misc queries) 10 January 5th 06 07:09 PM
Import Data from Access via DAO LHC01 Excel Programming 3 August 12th 04 11:24 AM


All times are GMT +1. The time now is 06:55 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"