-
Notifications
You must be signed in to change notification settings - Fork 1
/
loadFltData.asp
48 lines (38 loc) · 1.61 KB
/
loadFltData.asp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<%
response.expires=-1
flightDataStr = ""
'open the database. "db" was prepended because without it for some reason I had trouble connecting
db = "..\..\database\dbFlt" & request.querystring("data") & ".mdb"
Dim connFlight
Set connFlight = Server.CreateObject("ADODB.Connection")
sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & server.mappath(db) &";" & _
"Persist Security Info=False"
connFlight.Open(sConnection)
'create the tables
set rsMissionData = Server.CreateObject("ADODB.recordset")
set rsFlightData = Server.CreateObject("ADODB.recordset")
'query the data, ensure that bookmarking is enabled
rsMissionData.open "select * from [mission data]", connFlight, 1, 1
rsFlightData.open "select * from [flight data]", connFlight, 1, 1
'output the record in name/value pairs for each field
for each field in rsMissionData.fields
flightDataStr = flightDataStr & replace(field.name, " ", "") & "~" & field.value & "`"
next
'get rid of the last semicolon and ouput
flightDataStr = left(flightDataStr, len(flightDataStr)-1)
flightDataStr = flightDataStr & "^"
do until rsFlightData.eof
for each field in rsFlightData.fields
flightDataStr = flightDataStr & replace(field.name, " ", "") & "~" & field.value & "`"
next
flightDataStr = left(flightDataStr, len(flightDataStr)-1)
'for now, use a low resolution since users can not zoom in much
rsFlightData.move 15
if not rsFlightData.eof then flightDataStr = flightDataStr & "|"
loop
connFlight.Close
Set connFlight = nothing
flightDataStr = flightDataStr & "^" & request.querystring("data")
response.write flightDataStr
%>