Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have sporadically found an error when accessing an access database from
Excel VBA, sometimes I get double entries (lines) in Excel when there is only one entriy in Access database. The double entriy I see are just a copy of an existing line. Database are located in house on network drive. Question: Does anyone know the cause of this error / behaviour? The solution today is to verify that no double entries exists, and if it does, promt operator to re-run macro until it pass. VBA Code: With ActiveSheet.QueryTables.Add(Connection:=Array(Arra y( _ "ODBC;DSN=MS Access Database;DBQ=" & FileToOpen & ";FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;" _ )), Destination:=Range("A1")) .CommandText = Array( _ "SELECT BOAT.ShortID, BOAT.Rev, BOAT.TestGroup, BOAT.MPPoint, BOAT.MPDescription, BOAT.LtLow, BOAT.LtHigh, BOAT.Meas, BOAT.Unit, BOAT.Cause, " _ , _ "BOAT.CompName, BOAT.Action, BOAT.Comments, BOAT.TSResp, BOAT.Pos, BOAT.CompNumb, BOAT.RepairHistory, BOAT.RepCnt, BOAT.Status, BOAT.DateUpdate, " _ , _ "BOAT.IR, BOAT.DateStamp, BOAT.ID, BOAT.IDNumber, BOAT.MPGroup, BOAT.CustomerCom, BOAT.Loc FROM BOAT ORDER BY BOAT.IDNumber, BOAT.Loc") .Name = "Query from MS Access Database" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = False .AdjustColumnWidth = True .RefreshPeriod = 0 .PreserveColumnInfo = True .Refresh BackgroundQuery:=False End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error Message - accessing an Access database | Excel Programming | |||
Error Querying Access Database From Excel | Excel Programming | |||
Error while populating a combobox from Access database | Excel Programming | |||
Excel error while trying to import data from an Access database - MSQRY32.exe has generated errors | Excel Discussion (Misc queries) | |||
Excel VBA Access Database Error | Excel Programming |