M
MIchel Khennafi
Good morning
In the following Macro, we are trying to get all the fields from a connected
database. If you look at the macro, you'll see that there are mising field
names (refer to the portion where you only have ' ' ' ' ' ' in the Array
definition
Why is it? is it an array limitation? Is there a way to tell Excel we wqant
all the fields in this table without having to list all of them?
Thanks a lot for your help
'
Cells.Select
Selection.ClearContents
Selection.QueryTable.Delete
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=freight payment database;DBQ=X:\FREIGHT PAYMENT\Freight
Payment.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeou" _
), Array("t=5;")), Destination:=Range("origin"))
.CommandText = Array( _
"SELECT `report improper records to finance`.ID, `report improper
records to finance`.`Customer Number`, `report improper records to
finance`.`Airway Invoice #`, `report improper records to finance`.`B" _
, _
"alance Due Flag`, `report improper records to finance`.`CTSI Batch
Code`, `report improper records to finance`.`Bill to Number`, `report
improper records to finance`.`Bill Type`, `report improper reco" _
, _
"rds to finance`.Bound, `report improper records to
finance`.`Carrier Name`, `report improper records to finance`.`Check
Amount`, `report improper records to finance`.`Check Date`, `report improper
rec" _
, _
"ords to finance`.`Check Number`, `report improper records to
finance`.Shipper, `report improper records to finance`.`Shipper Address`,
`report improper records to finance`.`Shipper City`, `report impr" _
,,,,,,,,,,,,,,,,,,,,)
.Name = "Query from freight payment database_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
In the following Macro, we are trying to get all the fields from a connected
database. If you look at the macro, you'll see that there are mising field
names (refer to the portion where you only have ' ' ' ' ' ' in the Array
definition
Why is it? is it an array limitation? Is there a way to tell Excel we wqant
all the fields in this table without having to list all of them?
Thanks a lot for your help
'
Cells.Select
Selection.ClearContents
Selection.QueryTable.Delete
With ActiveSheet.QueryTables.Add(Connection:=Array(Array( _
"ODBC;DSN=freight payment database;DBQ=X:\FREIGHT PAYMENT\Freight
Payment.mdb;DriverId=25;FIL=MS Access;MaxBufferSize=2048;PageTimeou" _
), Array("t=5;")), Destination:=Range("origin"))
.CommandText = Array( _
"SELECT `report improper records to finance`.ID, `report improper
records to finance`.`Customer Number`, `report improper records to
finance`.`Airway Invoice #`, `report improper records to finance`.`B" _
, _
"alance Due Flag`, `report improper records to finance`.`CTSI Batch
Code`, `report improper records to finance`.`Bill to Number`, `report
improper records to finance`.`Bill Type`, `report improper reco" _
, _
"rds to finance`.Bound, `report improper records to
finance`.`Carrier Name`, `report improper records to finance`.`Check
Amount`, `report improper records to finance`.`Check Date`, `report improper
rec" _
, _
"ords to finance`.`Check Number`, `report improper records to
finance`.Shipper, `report improper records to finance`.`Shipper Address`,
`report improper records to finance`.`Shipper City`, `report impr" _
,,,,,,,,,,,,,,,,,,,,)
.Name = "Query from freight payment database_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True