• 热门标签
时间:2011-08-28 16:29来源:蓝天飞行翻译 作者:航空
曝光台 注意防骗 网曝天猫店富美金盛家居专营店坑蒙拐骗欺诈消费者

The second sub step calls an appending query that converts the imported data in the first sub step to the correct AERO2K data type. The appending query SQL code is:
'------------------------------------------------------------------------------
INSERT INTO AmocTraffic ( CallSign, DepartureTime, DepartureAirport, ArrivalAirport, AircraftType, Sources, MaxStopTime )
SELECT [CallSign], IIf([EntryTime]<240000,DateAdd('d',-1,DateValue([Forms]![ImportAmoc].TrafficFileDate)) & ' ' & Left([EntryTime],2) & ':' & Mid([EntryTime],3,2) & ':' & Right([EntryTime],2),IIf([EntryTime]<480000,DateValue([Forms]![ImportAmoc].Tr afficFileDate) & ' ' & (Left([EntryTime],2)-24) & ':' & Mid([EntryTime],3,2) & ':' & Right([EntryTime],2),DateAdd('d',1,DateValue([Forms]![ImportAmoc].TrafficFileD

 

ate)) & ' ' & (Left([EntryTime],2)-48) & ':' & Mid([EntryTime],3,2) & ':' & Right([EntryTime],2))) AS DepartureTime, [DepartureAirport], [ArrivalAirport], [AircraftType], 'AMOC' AS Sources, CDate('3000-01-01 00:00:00') AS MaxStopTime
FROM Amoc_ImportedTraffic;
'------------------------------------------------------------------------------

3.2.3.1.3. Sub step 3.3 - Delete temporary table Amoc_ImportedTraffic

The third sub step empties the temporary table Amoc_ImportedTraffic. The executed code is:
'------------------------------------------------------------------------------
DoCmd.DeleteObject acTable, "Amoc_ImportedTraffic"

DoCmd.TransferDatabase acImport, "Microsoft Access", CurrentDb.Name, acTable, "Amoc_ImportedTraffic", "ModelAmoc_ImportedTraffic", True
'------------------------------------------------------------------------------

3.2.3.1.4. Sub step 3.4 - Calculating for each flight the possible arrival time

The fourth sub step goal is to calculate for each flight its possible arrival time. Because the AMOC traffic text file doesn’t contain the arrival time and also because after the flight legs importing (see Step 4 - Import AMOC flight file) the flight heads and flight legs will not be linked, a particular solution had to be adopted. This solution is described below: '------------------------------------------------------------------------------
Sort the AmocTraffic table ascending by CallSign and DepartureTime
For each set of flight heads that have the same CallSign

For the last flight head in the set, the MaxStopTime (possible arrival time) will be set to <3000-01-01 00:00:00>. In fact it remains unchanged because for all the flight heads, the MaxStopTime is set to this value in the second sub step that was presented before
For all other flight heads (all without the last one) the MaxStopTime will be set to the <DepartureTime minus 1 second> of the following flight head
[]

'------------------------------------------------------------------------------ The state of the traffic table after this step is not final. Some other modification will take place after executing the following steps like changing the departure and arrival airport codes to IATA code, deleting the inconsistent flight heads, converting the date/time fields' values to GMT time…
Step 4 - Import AMOC flight file
To complete this step, three other sub steps must be done.

3.2.3.1.5.  Sub step 4.1 - Importing AMOC flight text file into the temporary table Amoc_ImportedFlight
This first sub step implies the physical importing of the AMOC flight text file. To do that the next code is used:
'------------------------------------------------------------------------------
DoCmd.TransferText acImportDelim, "Amoc Flight Import Specification", "Amoc_ImportedFlight", FileName, False, ""
'------------------------------------------------------------------------------
The "Amoc Flight Import Specification" is a predefined mode to import the AMOC flight text file, which’s path\name is stored in the FileName variable. This specification selects from the text file only the fields that the AERO2K needs and also defines each one’s date type (see Table 49).
 
中国航空网 www.aero.cn
航空翻译 www.aviation.cn
本文链接地址:AERO2K Flight Movement Inventory Project Report(49)