View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Updating Access from Excel Macro


-----Original Message-----
"David Slicer" wrote ...

Access, I know how to query
the information into a sheet, but have been

unsuccessful
at getting an update to the database to work from the

macro

Post the code you are using to fetch the data.

Jamie.

--
.

The code I use was generated through record macro and
using the external data new query

With ActiveSheet.QueryTables.Add(Connection:=Array
(Array( _
"ODBC;DSN=MS Access
Database;DBQ=H:\dvctracking\DVCTracking.mdb;Defaul tDir=H:\d
vctracking;DriverId=25;FIL=MS Access;MaxBufferSize=204" _
), Array("8;PageTimeout=5;")), Destination:=Range
("A1"))
.CommandText = Array( _
"SELECT HomeBase.HomeBase" & Chr(13) & "" & Chr
(10) & "FROM `H:\dvctracking\DVCTracking`.HomeBase
HomeBase" _
)
.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