Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

485 lines
15 KiB

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.3#0"; "COMCTL32.OCX"
  4. Begin VB.Form frmdelta
  5. BorderStyle = 3 'Fixed Dialog
  6. Caption = "vew"
  7. ClientHeight = 5205
  8. ClientLeft = 1830
  9. ClientTop = 1350
  10. ClientWidth = 7155
  11. Icon = "delta.frx":0000
  12. KeyPreview = -1 'True
  13. LinkTopic = "Form1"
  14. MaxButton = 0 'False
  15. MinButton = 0 'False
  16. PaletteMode = 1 'UseZOrder
  17. ScaleHeight = 5205
  18. ScaleWidth = 7155
  19. ShowInTaskbar = 0 'False
  20. WhatsThisButton = -1 'True
  21. WhatsThisHelp = -1 'True
  22. Begin ComctlLib.ListView lvDelta
  23. Height = 3855
  24. Left = 120
  25. TabIndex = 5
  26. Top = 720
  27. WhatsThisHelpID = 11010
  28. Width = 7095
  29. _ExtentX = 12515
  30. _ExtentY = 6800
  31. View = 3
  32. LabelEdit = 1
  33. LabelWrap = -1 'True
  34. HideSelection = 0 'False
  35. _Version = 327682
  36. ForeColor = -2147483640
  37. BackColor = -2147483643
  38. BorderStyle = 1
  39. Appearance = 1
  40. NumItems = 11
  41. BeginProperty ColumnHeader(1) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  42. Key = ""
  43. Object.Tag = ""
  44. Text = "access id"
  45. Object.Width = 1411
  46. EndProperty
  47. BeginProperty ColumnHeader(2) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  48. SubItemIndex = 1
  49. Key = ""
  50. Object.Tag = ""
  51. Text = "Country"
  52. Object.Width = 3704
  53. EndProperty
  54. BeginProperty ColumnHeader(3) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  55. SubItemIndex = 2
  56. Key = ""
  57. Object.Tag = ""
  58. Text = "Regionid"
  59. Object.Width = 1499
  60. EndProperty
  61. BeginProperty ColumnHeader(4) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  62. SubItemIndex = 3
  63. Key = ""
  64. Object.Tag = ""
  65. Text = "popname"
  66. Object.Width = 1587
  67. EndProperty
  68. BeginProperty ColumnHeader(5) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  69. SubItemIndex = 4
  70. Key = ""
  71. Object.Tag = ""
  72. Text = "area code"
  73. Object.Width = 1587
  74. EndProperty
  75. BeginProperty ColumnHeader(6) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  76. SubItemIndex = 5
  77. Key = ""
  78. Object.Tag = ""
  79. Text = "access num"
  80. Object.Width = 1764
  81. EndProperty
  82. BeginProperty ColumnHeader(7) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  83. SubItemIndex = 6
  84. Key = ""
  85. Object.Tag = ""
  86. Text = "minimum speed"
  87. Object.Width = 1587
  88. EndProperty
  89. BeginProperty ColumnHeader(8) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  90. SubItemIndex = 7
  91. Key = ""
  92. Object.Tag = ""
  93. Text = "maximum speek"
  94. Object.Width = 1587
  95. EndProperty
  96. BeginProperty ColumnHeader(9) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  97. SubItemIndex = 8
  98. Key = ""
  99. Object.Tag = ""
  100. Text = "flip/reserved"
  101. Object.Width = 1235
  102. EndProperty
  103. BeginProperty ColumnHeader(10) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  104. SubItemIndex = 9
  105. Key = ""
  106. Object.Tag = ""
  107. Text = "flags"
  108. Object.Width = 1235
  109. EndProperty
  110. BeginProperty ColumnHeader(11) {0713E8C7-850A-101B-AFC0-4210102A8DA7}
  111. SubItemIndex = 10
  112. Key = ""
  113. Object.Tag = ""
  114. Text = "dialup entry"
  115. Object.Width = 2381
  116. EndProperty
  117. End
  118. Begin VB.ComboBox cmbSelect
  119. Height = 315
  120. Left = 1440
  121. Style = 2 'Dropdown List
  122. TabIndex = 1
  123. Top = 195
  124. WhatsThisHelpID = 11000
  125. Width = 2835
  126. End
  127. Begin VB.CommandButton cmbCancel
  128. Cancel = -1 'True
  129. Caption = "close"
  130. Height = 375
  131. Left = 5520
  132. TabIndex = 4
  133. Top = 4680
  134. WhatsThisHelpID = 10020
  135. Width = 1695
  136. End
  137. Begin VB.CommandButton cmbdprint
  138. Caption = "print"
  139. Height = 375
  140. Left = 1680
  141. TabIndex = 2
  142. Top = 4680
  143. WhatsThisHelpID = 10050
  144. Width = 1695
  145. End
  146. Begin VB.CommandButton cmbSave
  147. Caption = "save"
  148. Height = 375
  149. Left = 3600
  150. TabIndex = 3
  151. Top = 4680
  152. WhatsThisHelpID = 11020
  153. Width = 1695
  154. End
  155. Begin MSComDlg.CommonDialog cmdialog
  156. Left = 2040
  157. Top = 4680
  158. _ExtentX = 847
  159. _ExtentY = 847
  160. _Version = 393216
  161. End
  162. Begin VB.Label ListLabel
  163. Alignment = 1 'Right Justify
  164. Caption = "file"
  165. Height = 255
  166. Left = 120
  167. TabIndex = 0
  168. Top = 225
  169. WhatsThisHelpID = 11000
  170. Width = 1215
  171. End
  172. End
  173. Attribute VB_Name = "frmdelta"
  174. Attribute VB_GlobalNameSpace = False
  175. Attribute VB_Creatable = False
  176. Attribute VB_PredeclaredId = True
  177. Attribute VB_Exposed = False
  178. Option Explicit
  179. Private Sub Form_Load()
  180. Dim sqlstm As String
  181. Dim rsversion As Recordset
  182. Dim version As Integer
  183. Dim deltacount As Integer
  184. Dim intX As Integer
  185. On Error GoTo LoadErr
  186. CenterForm Me, Screen
  187. LoadDeltaResources
  188. cmbSelect.ItemData(0) = 0
  189. Set rsversion = gsyspb.OpenRecordset("Select max(DeltaNum) as HiVersion from Delta WHERE NewVersion=0")
  190. If IsNull(rsversion!HiVersion) Then
  191. version = 0
  192. Else
  193. version = rsversion!HiVersion
  194. End If
  195. rsversion.Close
  196. Set rsversion = Nothing
  197. If version > 1 Then
  198. If version < 6 Then
  199. deltacount = version - 1
  200. Else
  201. deltacount = 5
  202. End If
  203. For intX = 1 To deltacount
  204. cmbSelect.AddItem LoadResString(5206) & " " & version - 1
  205. cmbSelect.ItemData(intX) = version
  206. version = version - 1
  207. Next
  208. End If
  209. 'FillDeltaList
  210. Screen.MousePointer = 0
  211. Exit Sub
  212. LoadErr:
  213. Screen.MousePointer = 0
  214. Exit Sub
  215. End Sub
  216. Function LoadDeltaResources()
  217. On Error GoTo LoadErr
  218. 'column headers
  219. lvDelta.ColumnHeaders(1).Text = LoadResString(6061) ' Access ID
  220. lvDelta.ColumnHeaders(2).Text = LoadResString(6062) ' Country
  221. lvDelta.ColumnHeaders(3).Text = LoadResString(6063) ' RegionID
  222. lvDelta.ColumnHeaders(4).Text = LoadResString(6064) ' Pop Name
  223. lvDelta.ColumnHeaders(5).Text = LoadResString(6065) ' Area Code
  224. lvDelta.ColumnHeaders(6).Text = LoadResString(6066) ' Access Number
  225. lvDelta.ColumnHeaders(7).Text = LoadResString(6067) ' Min Speed
  226. lvDelta.ColumnHeaders(8).Text = LoadResString(6068) ' Max Speed
  227. lvDelta.ColumnHeaders(9).Text = LoadResString(6069) ' Flip (reserved)
  228. lvDelta.ColumnHeaders(10).Text = LoadResString(6070) ' Flags
  229. lvDelta.ColumnHeaders(11).Text = LoadResString(6071) ' Dialup Entry
  230. Me.Caption = LoadResString(5208) & " " & gsCurrentPB
  231. ListLabel.Caption = LoadResString(5209)
  232. cmbdprint.Caption = LoadResString(1008)
  233. cmbSave.Caption = LoadResString(1014)
  234. cmbCancel.Caption = LoadResString(1005)
  235. cmbSelect.AddItem LoadResString(5207)
  236. cmbSelect.Text = LoadResString(5207)
  237. ' set fonts
  238. SetFonts Me
  239. lvDelta.Font.Charset = gfnt.Charset
  240. lvDelta.Font.Name = gfnt.Name
  241. lvDelta.Font.Size = gfnt.Size
  242. On Error GoTo 0
  243. Exit Function
  244. LoadErr:
  245. Exit Function
  246. End Function
  247. Private Sub cmbCancel_Click()
  248. CloseDB
  249. Unload Me
  250. End Sub
  251. Private Sub CloseDB()
  252. rsDataDelta.Close
  253. dbDataDelta.Close
  254. set temp = Nothing
  255. End Sub
  256. Private Sub cmbdprint_Click()
  257. Dim X As Printer
  258. Dim linecount As Integer
  259. Dim sqlstm As String
  260. Dim fieldnum As Integer
  261. Dim renewmaster As Recordset
  262. On Error GoTo ErrTrap
  263. Screen.MousePointer = 13
  264. cmbdprint.Enabled = False
  265. ' popup print screen, set parms and print
  266. Load frmPrinting
  267. frmPrinting.JobType = 1
  268. frmPrinting.JobParm1 = cmbSelect.ListIndex
  269. frmPrinting.Show vbModal
  270. cmbdprint.Enabled = True
  271. cmbdprint.SetFocus
  272. Screen.MousePointer = 0
  273. Exit Sub
  274. ErrTrap:
  275. cmbdprint.Enabled = True
  276. Screen.MousePointer = 0
  277. Exit Sub
  278. End Sub
  279. Private Sub cmbSelect_Click()
  280. Dim AccessID As String, CountryNum As String, RegionID As String, POPName As String
  281. Dim AreaCode As String, AccessNum As String, strStatus As String, MinSpeed As String
  282. Dim MaxSpeed As String, Flip As String, Flags As String, DialUp As String
  283. Dim Comments As String
  284. Dim sqlstm As String, renewsql As String
  285. Dim deltanum As Integer
  286. AccessID = LoadResString(6061)
  287. CountryNum = LoadResString(6062)
  288. RegionID = LoadResString(6063)
  289. POPName = LoadResString(6064)
  290. AreaCode = LoadResString(6065)
  291. AccessNum = LoadResString(6066)
  292. MinSpeed = LoadResString(6067)
  293. MaxSpeed = LoadResString(6068)
  294. Flip = LoadResString(6069)
  295. Flags = LoadResString(6070)
  296. DialUp = LoadResString(6071)
  297. strStatus = LoadResString(6072)
  298. Comments = LoadResString(6074)
  299. If cmbSelect.Text <> "" Then
  300. deltanum = cmbSelect.ItemData(cmbSelect.ListIndex)
  301. If deltanum = 0 Then
  302. renewsql = "SELECT AccessNumberId, CountryNumber, RegionId, CityName, AreaCode, " & _
  303. "AccessNumber, Status, MinimumSpeed, Maximumspeed, flipFactor, Flags, " & _
  304. "ScriptID, Comments FROM DialUpPort WHERE Status = '1' order by AccessNumberId "
  305. Set temp = gsyspb.OpenRecordset(renewsql, dbOpenSnapshot)
  306. Else
  307. sqlstm = "SELECT delta.* From delta WHERE delta.DeltaNum = " & deltanum & " and delta.NewVersion <> 1 order by AccessNumberId"
  308. renewsql = "SELECT delta.AccessNumberId, delta.CountryNumber, delta.RegionId, " & _
  309. "delta.CityName, delta.AreaCode, delta.AccessNumber, delta.MinimumSpeed, " & _
  310. "delta.MaximumSpeed, delta.Flipfactor, delta.Flags, delta.ScriptId " & _
  311. "FROM delta WHERE delta.DeltaNum = " & deltanum & _
  312. " and delta.NewVersion <> 1 order by AccessNumberId"
  313. Set temp = gsyspb.OpenRecordset(sqlstm, dbOpenSnapshot)
  314. End If
  315. 'new
  316. Set dbDataDelta = OpenDatabase(gsCurrentPBPath)
  317. Set rsDataDelta = dbDataDelta.OpenRecordset(renewsql)
  318. FillDeltaList
  319. If rsDataDelta.RecordCount <> 0 Then
  320. cmbdprint.Enabled = True
  321. cmbSave.Enabled = True
  322. Else
  323. cmbdprint.Enabled = False
  324. cmbSave.Enabled = False
  325. End If
  326. End If
  327. End Sub
  328. ' Save_Click()
  329. Private Sub cmbSave_Click()
  330. Dim filesaveas As String
  331. Dim renewset As Recordset
  332. Dim intX As Integer
  333. On Error GoTo ErrTrap
  334. cmdialog.FileName = ""
  335. cmdialog.Flags = cdlOFNHideReadOnly
  336. cmdialog.Filter = "*.pbk | *.pbk"
  337. cmdialog.FilterIndex = 1
  338. cmdialog.ShowSave
  339. filesaveas = cmdialog.FileName
  340. If filesaveas = "" Then Exit Sub
  341. Screen.MousePointer = 11
  342. If CheckPath(filesaveas) = 0 Then
  343. intX = MsgBox(LoadResString(6020) & Chr(13) & filesaveas & Chr$(13) & _
  344. LoadResString(6021), _
  345. vbQuestion + vbYesNo + vbDefaultButton2)
  346. If intX = 7 Then
  347. Screen.MousePointer = 0
  348. Exit Sub
  349. End If
  350. End If
  351. If cmbSelect.ListIndex = 0 Then
  352. Set renewset = gsyspb.OpenRecordset("DialUpPort", dbOpenSnapshot)
  353. masterOutfile filesaveas, renewset
  354. renewset.Close
  355. Else
  356. deltaoutfile filesaveas, temp
  357. End If
  358. Screen.MousePointer = 0
  359. Exit Sub
  360. ErrTrap:
  361. Screen.MousePointer = 0
  362. If Err.Number = 32755 Then
  363. Exit Sub
  364. ElseIf Err.Number = 75 Then
  365. MsgBox LoadResString(6022), vbInformation
  366. Exit Sub
  367. Else
  368. Exit Sub
  369. End If
  370. End Sub
  371. Private Sub Form_KeyPress(KeyAscii As Integer)
  372. CheckChar KeyAscii
  373. End Sub
  374. Function FillDeltaList() As Integer
  375. Dim strTemp As String
  376. Dim intRow, intX As Integer
  377. Dim itmX As ListItem
  378. On Error GoTo ErrTrap
  379. If gsCurrentPB = "" Then
  380. lvDelta.ListItems.Clear
  381. Exit Function
  382. End If
  383. Me.Enabled = False
  384. Screen.MousePointer = 11
  385. If rsDataDelta.BOF = False Then
  386. rsDataDelta.MoveLast
  387. 'If rsDataDelta.RecordCount > 50 Then RefreshPBLabel "loading"
  388. lvDelta.ListItems.Clear
  389. lvDelta.Sorted = False
  390. rsDataDelta.MoveFirst
  391. Do While Not rsDataDelta.EOF
  392. Set itmX = lvDelta.ListItems.Add()
  393. With itmX
  394. .Text = rsDataDelta!AccessNumberId
  395. .SubItems(1) = rsDataDelta!CountryNumber
  396. .SubItems(2) = rsDataDelta!RegionID
  397. .SubItems(3) = rsDataDelta!CityName
  398. .SubItems(4) = rsDataDelta!AreaCode
  399. .SubItems(5) = rsDataDelta!AccessNumber
  400. '.SubItems(5) = gStatusText(rsDataDelta!status)
  401. .SubItems(6) = rsDataDelta!MinimumSpeed
  402. .SubItems(7) = rsDataDelta!MaximumSpeed
  403. .SubItems(8) = rsDataDelta!FlipFactor
  404. .SubItems(9) = rsDataDelta!Flags
  405. .SubItems(10) = rsDataDelta!ScriptID
  406. '.SubItems(9) = rsDataDelta!ScriptId
  407. '.SubItems(9) = rsDataDelta!Comments
  408. strTemp = "Key:" & rsDataDelta!AccessNumberId
  409. .Key = strTemp
  410. End With
  411. If rsDataDelta.AbsolutePosition Mod 300 = 0 Then DoEvents
  412. rsDataDelta.MoveNext
  413. Loop
  414. Else
  415. lvDelta.ListItems.Clear
  416. End If
  417. lvDelta.Sorted = True
  418. Me.Enabled = True
  419. Screen.MousePointer = 0
  420. Exit Function
  421. ErrTrap:
  422. Me.Enabled = True
  423. FillDeltaList = 1
  424. Screen.MousePointer = 0
  425. Exit Function
  426. End Function