Leaked source code of windows server 2003
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.

1031 lines
32 KiB

  1. VERSION 5.00
  2. Object = "{BDC217C8-ED16-11CD-956C-0000C04E4C0A}#1.1#0"; "TABCTL32.OCX"
  3. Begin VB.Form frmPopInsert
  4. BorderStyle = 3 'Fixed Dialog
  5. Caption = "add"
  6. ClientHeight = 4290
  7. ClientLeft = 720
  8. ClientTop = 1530
  9. ClientWidth = 7365
  10. Icon = "PopIns.frx":0000
  11. KeyPreview = -1 'True
  12. LinkTopic = "Form1"
  13. MaxButton = 0 'False
  14. MinButton = 0 'False
  15. PaletteMode = 1 'UseZOrder
  16. ScaleHeight = 4290
  17. ScaleWidth = 7365
  18. ShowInTaskbar = 0 'False
  19. WhatsThisButton = -1 'True
  20. WhatsThisHelp = -1 'True
  21. Begin VB.CommandButton cmdOK
  22. Caption = "ok"
  23. Default = -1 'True
  24. Height = 375
  25. Left = 3390
  26. TabIndex = 36
  27. Top = 3810
  28. WhatsThisHelpID = 10030
  29. Width = 1170
  30. End
  31. Begin VB.CommandButton cmbclose
  32. Cancel = -1 'True
  33. Caption = "cancel"
  34. Height = 375
  35. Left = 4725
  36. TabIndex = 37
  37. Top = 3810
  38. WhatsThisHelpID = 10040
  39. Width = 1170
  40. End
  41. Begin VB.CommandButton cmdSave
  42. Caption = "save"
  43. Height = 375
  44. Left = 6030
  45. TabIndex = 38
  46. Top = 3810
  47. WhatsThisHelpID = 10010
  48. Width = 1185
  49. End
  50. Begin TabDlg.SSTab SSTab1
  51. Height = 3495
  52. Left = 120
  53. TabIndex = 39
  54. Top = 135
  55. WhatsThisHelpID = 10060
  56. Width = 7095
  57. _ExtentX = 12515
  58. _ExtentY = 6165
  59. _Version = 393216
  60. Style = 1
  61. TabHeight = 520
  62. BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
  63. Name = "MS Sans Serif"
  64. Size = 8.25
  65. Charset = 0
  66. Weight = 400
  67. Underline = 0 'False
  68. Italic = 0 'False
  69. Strikethrough = 0 'False
  70. EndProperty
  71. TabCaption(0) = "access"
  72. TabPicture(0) = "PopIns.frx":000C
  73. Tab(0).ControlEnabled= -1 'True
  74. Tab(0).Control(0)= "picContainer(0)"
  75. Tab(0).Control(0).Enabled= 0 'False
  76. Tab(0).ControlCount= 1
  77. TabCaption(1) = "settings"
  78. TabPicture(1) = "PopIns.frx":0028
  79. Tab(1).ControlEnabled= 0 'False
  80. Tab(1).Control(0)= "picContainer(1)"
  81. Tab(1).Control(0).Enabled= 0 'False
  82. Tab(1).ControlCount= 1
  83. TabCaption(2) = "comments"
  84. TabPicture(2) = "PopIns.frx":0044
  85. Tab(2).ControlEnabled= 0 'False
  86. Tab(2).Control(0)= "picContainer(2)"
  87. Tab(2).Control(0).Enabled= 0 'False
  88. Tab(2).ControlCount= 1
  89. Begin VB.PictureBox picContainer
  90. BorderStyle = 0 'None
  91. Height = 2775
  92. Index = 2
  93. Left = -74700
  94. ScaleHeight = 2775
  95. ScaleWidth = 6555
  96. TabIndex = 35
  97. TabStop = 0 'False
  98. Top = 555
  99. Visible = 0 'False
  100. Width = 6555
  101. Begin VB.TextBox txtcomment
  102. ForeColor = &H00000000&
  103. Height = 2580
  104. Left = 75
  105. MaxLength = 256
  106. MultiLine = -1 'True
  107. ScrollBars = 2 'Vertical
  108. TabIndex = 27
  109. Top = 45
  110. WhatsThisHelpID = 50000
  111. Width = 6360
  112. End
  113. End
  114. Begin VB.PictureBox picContainer
  115. BorderStyle = 0 'None
  116. Height = 2940
  117. Index = 0
  118. Left = 105
  119. ScaleHeight = 2940
  120. ScaleWidth = 6855
  121. TabIndex = 32
  122. TabStop = 0 'False
  123. Top = 420
  124. Width = 6855
  125. Begin VB.TextBox maskAccNo
  126. Height = 300
  127. HelpContextID = 30050
  128. Left = 5130
  129. MaxLength = 40
  130. TabIndex = 24
  131. Top = 1980
  132. WhatsThisHelpID = 30050
  133. Width = 1590
  134. End
  135. Begin VB.TextBox maskArea
  136. Height = 300
  137. Left = 1710
  138. MaxLength = 10
  139. TabIndex = 22
  140. Top = 1995
  141. WhatsThisHelpID = 30060
  142. Width = 1290
  143. End
  144. Begin VB.ComboBox dbCmbCty
  145. Height = 315
  146. ItemData = "PopIns.frx":0060
  147. Left = 1710
  148. List = "PopIns.frx":0062
  149. Style = 2 'Dropdown List
  150. TabIndex = 18
  151. Top = 780
  152. WhatsThisHelpID = 30020
  153. Width = 2820
  154. End
  155. Begin VB.ComboBox cmbRegion
  156. Height = 315
  157. ItemData = "PopIns.frx":0064
  158. Left = 1710
  159. List = "PopIns.frx":0066
  160. Style = 2 'Dropdown List
  161. TabIndex = 20
  162. Top = 1305
  163. WhatsThisHelpID = 30040
  164. Width = 2820
  165. End
  166. Begin VB.ComboBox cmbstatus
  167. ForeColor = &H00000000&
  168. Height = 315
  169. ItemData = "PopIns.frx":0068
  170. Left = 1710
  171. List = "PopIns.frx":006A
  172. Style = 2 'Dropdown List
  173. TabIndex = 26
  174. Top = 2520
  175. WhatsThisHelpID = 30070
  176. Width = 1545
  177. End
  178. Begin VB.TextBox txtcity
  179. ForeColor = &H00000000&
  180. Height = 285
  181. Left = 1710
  182. MaxLength = 30
  183. TabIndex = 16
  184. Top = 150
  185. WhatsThisHelpID = 30010
  186. Width = 2805
  187. End
  188. Begin VB.TextBox txtid
  189. BackColor = &H8000000F&
  190. ForeColor = &H00000000&
  191. Height = 285
  192. HelpContextID = 3000
  193. Left = 4635
  194. MaxLength = 25
  195. TabIndex = 33
  196. TabStop = 0 'False
  197. Top = 135
  198. Visible = 0 'False
  199. Width = 510
  200. End
  201. Begin VB.Label Label3
  202. BorderStyle = 1 'Fixed Single
  203. ForeColor = &H000000C0&
  204. Height = 255
  205. Left = 4740
  206. TabIndex = 34
  207. Top = 1365
  208. Visible = 0 'False
  209. Width = 570
  210. End
  211. Begin VB.Label Label8
  212. Alignment = 2 'Center
  213. BackStyle = 0 'Transparent
  214. BorderStyle = 1 'Fixed Single
  215. ForeColor = &H00000000&
  216. Height = 300
  217. Left = 5130
  218. TabIndex = 29
  219. Top = 2475
  220. Visible = 0 'False
  221. Width = 1590
  222. End
  223. Begin VB.Label Label7
  224. Alignment = 1 'Right Justify
  225. Caption = "status"
  226. Height = 255
  227. Left = 3420
  228. TabIndex = 28
  229. Top = 2550
  230. Visible = 0 'False
  231. Width = 1605
  232. End
  233. Begin VB.Label StatusLabel
  234. Alignment = 1 'Right Justify
  235. Caption = "statss"
  236. Height = 255
  237. Left = 255
  238. TabIndex = 25
  239. Top = 2565
  240. WhatsThisHelpID = 30070
  241. Width = 1350
  242. End
  243. Begin VB.Label AccessLabel
  244. Alignment = 1 'Right Justify
  245. Caption = "access num"
  246. Height = 255
  247. Left = 3390
  248. TabIndex = 23
  249. Top = 2040
  250. WhatsThisHelpID = 30050
  251. Width = 1635
  252. End
  253. Begin VB.Label AreaLabel
  254. Alignment = 1 'Right Justify
  255. Caption = "&Area code:"
  256. Height = 255
  257. Left = 105
  258. TabIndex = 21
  259. Top = 2040
  260. WhatsThisHelpID = 30060
  261. Width = 1515
  262. End
  263. Begin VB.Label RegionLabel
  264. Alignment = 1 'Right Justify
  265. Caption = "&Region:"
  266. Height = 255
  267. Left = 135
  268. TabIndex = 19
  269. Top = 1335
  270. WhatsThisHelpID = 30040
  271. Width = 1455
  272. End
  273. Begin VB.Label POPLabel
  274. Alignment = 1 'Right Justify
  275. Caption = "&pop name:"
  276. Height = 255
  277. Left = 105
  278. TabIndex = 15
  279. Top = 165
  280. WhatsThisHelpID = 30010
  281. Width = 1500
  282. End
  283. Begin VB.Label CountryLabel
  284. Alignment = 1 'Right Justify
  285. Caption = "&Country/ Dependency:"
  286. Height = 480
  287. Left = 135
  288. TabIndex = 17
  289. Top = 720
  290. WhatsThisHelpID = 30020
  291. Width = 1470
  292. End
  293. End
  294. Begin VB.PictureBox picContainer
  295. BorderStyle = 0 'None
  296. Height = 3015
  297. Index = 1
  298. Left = -74955
  299. ScaleHeight = 3015
  300. ScaleWidth = 6855
  301. TabIndex = 31
  302. TabStop = 0 'False
  303. Top = 390
  304. Visible = 0 'False
  305. Width = 6855
  306. Begin VB.Frame FlagFrame
  307. Caption = "settings"
  308. Height = 3015
  309. Left = 240
  310. TabIndex = 0
  311. Top = 0
  312. WhatsThisHelpID = 40030
  313. Width = 2655
  314. Begin VB.CheckBox FlagCheck
  315. Caption = "cust 2"
  316. Height = 255
  317. Index = 7
  318. Left = 240
  319. TabIndex = 8
  320. Top = 2640
  321. WhatsThisHelpID = 40090
  322. Width = 2295
  323. End
  324. Begin VB.CheckBox FlagCheck
  325. Caption = "sur"
  326. Height = 255
  327. Index = 6
  328. Left = 240
  329. TabIndex = 3
  330. Top = 960
  331. WhatsThisHelpID = 40060
  332. Width = 2295
  333. End
  334. Begin VB.CheckBox FlagCheck
  335. Caption = "multi"
  336. Height = 255
  337. Index = 5
  338. Left = 240
  339. TabIndex = 6
  340. Top = 1965
  341. WhatsThisHelpID = 40100
  342. Width = 2295
  343. End
  344. Begin VB.CheckBox FlagCheck
  345. Caption = "cust 1"
  346. Height = 255
  347. Index = 4
  348. Left = 240
  349. TabIndex = 7
  350. Top = 2295
  351. WhatsThisHelpID = 40090
  352. Width = 2295
  353. End
  354. Begin VB.CheckBox FlagCheck
  355. Caption = "isdn"
  356. Height = 255
  357. Index = 3
  358. Left = 240
  359. TabIndex = 5
  360. Top = 1635
  361. WhatsThisHelpID = 40080
  362. Width = 2295
  363. End
  364. Begin VB.CheckBox FlagCheck
  365. Caption = "mod"
  366. Height = 255
  367. Index = 2
  368. Left = 240
  369. TabIndex = 4
  370. Top = 1290
  371. WhatsThisHelpID = 40070
  372. Width = 2295
  373. End
  374. Begin VB.CheckBox FlagCheck
  375. Caption = "up"
  376. Height = 255
  377. Index = 1
  378. Left = 240
  379. TabIndex = 2
  380. Top = 615
  381. WhatsThisHelpID = 40050
  382. Width = 2295
  383. End
  384. Begin VB.CheckBox FlagCheck
  385. Caption = "sign on"
  386. Height = 255
  387. Index = 0
  388. Left = 240
  389. TabIndex = 1
  390. Top = 285
  391. WhatsThisHelpID = 40040
  392. Width = 2295
  393. End
  394. End
  395. Begin VB.Frame analogFrame
  396. Caption = "speed"
  397. Height = 1455
  398. Left = 3585
  399. TabIndex = 30
  400. Top = 1500
  401. Width = 3105
  402. Begin VB.ComboBox cmbmin
  403. ForeColor = &H00000000&
  404. Height = 315
  405. ItemData = "PopIns.frx":006C
  406. Left = 1215
  407. List = "PopIns.frx":0088
  408. TabIndex = 12
  409. Top = 405
  410. WhatsThisHelpID = 40010
  411. Width = 1095
  412. End
  413. Begin VB.ComboBox cmbmax
  414. ForeColor = &H00000000&
  415. Height = 315
  416. ItemData = "PopIns.frx":00C4
  417. Left = 1215
  418. List = "PopIns.frx":00E0
  419. TabIndex = 14
  420. Top = 930
  421. WhatsThisHelpID = 40020
  422. Width = 1095
  423. End
  424. Begin VB.Label MinLabel
  425. Alignment = 1 'Right Justify
  426. Caption = "min"
  427. Height = 255
  428. Left = 165
  429. TabIndex = 11
  430. Top = 480
  431. WhatsThisHelpID = 40010
  432. Width = 1005
  433. End
  434. Begin VB.Label MaxLabel
  435. Alignment = 1 'Right Justify
  436. Caption = "max"
  437. Height = 255
  438. Left = 195
  439. TabIndex = 13
  440. Top = 990
  441. WhatsThisHelpID = 40020
  442. Width = 975
  443. End
  444. End
  445. Begin VB.TextBox txtscript
  446. ForeColor = &H00000000&
  447. Height = 285
  448. Left = 3570
  449. MaxLength = 50
  450. TabIndex = 10
  451. Top = 570
  452. WhatsThisHelpID = 40000
  453. Width = 3135
  454. End
  455. Begin VB.Label dunLabel
  456. Caption = "dun"
  457. Height = 255
  458. Left = 3555
  459. TabIndex = 9
  460. Top = 300
  461. WhatsThisHelpID = 40000
  462. Width = 2775
  463. End
  464. End
  465. End
  466. End
  467. Attribute VB_Name = "frmPopInsert"
  468. Attribute VB_GlobalNameSpace = False
  469. Attribute VB_Creatable = False
  470. Attribute VB_PredeclaredId = True
  471. Attribute VB_Exposed = False
  472. Option Explicit
  473. Function InsertPOP() As Integer
  474. Dim deltnum, vernum As Integer
  475. Dim test As String
  476. Dim deltasql As String
  477. Dim i As Integer
  478. Dim addFound As Integer
  479. Dim m As Integer
  480. Dim v As Long
  481. Dim n As Long
  482. Dim bool As Integer
  483. Dim mydesc, sqlstm, countryname As String
  484. ReDim bitvaluearray(10) As bitValues
  485. On Error GoTo ErrTrap
  486. ' validate input
  487. If dbCmbCty.Text = "" Then
  488. MsgBox LoadResString(6044), 0
  489. SSTab1.Tab = 0
  490. dbCmbCty.SetFocus
  491. Exit Function
  492. ElseIf txtcity.Text = "" Then
  493. MsgBox LoadResString(6045), 0
  494. SSTab1.Tab = 0
  495. txtcity.SetFocus
  496. Exit Function
  497. ElseIf maskArea.Text = "" Then
  498. MsgBox LoadResString(6046), 0
  499. SSTab1.Tab = 0
  500. maskArea.SetFocus
  501. Exit Function
  502. ElseIf maskAccNo.Text = "" Then
  503. MsgBox LoadResString(6047), 0
  504. SSTab1.Tab = 0
  505. maskAccNo.SetFocus
  506. Exit Function
  507. ElseIf cmbstatus.Text = "" Then
  508. MsgBox LoadResString(6048), 0
  509. SSTab1.Tab = 0
  510. cmbstatus.SetFocus
  511. Exit Function
  512. End If
  513. Screen.MousePointer = 11
  514. Set GsysDial = gsyspb.OpenRecordset("DialUpPort", dbOpenDynaset)
  515. Set GsysDelta = gsyspb.OpenRecordset("Select * from Delta order by DeltaNum", dbOpenDynaset)
  516. result = 0
  517. For m = 0 To 7
  518. Select Case m
  519. Case 0, 2, 3, 5
  520. result = result + (2 ^ m) * Abs(FlagCheck(m).Value - 1)
  521. Case Else
  522. result = result + (2 ^ m) * FlagCheck(m).Value
  523. End Select
  524. Next m
  525. GsysDial.AddNew
  526. GsysDial!AccessNumberId = Val(txtid.Text)
  527. GsysDial!AreaCode = maskArea.Text
  528. GsysDial!AccessNumber = maskAccNo.Text
  529. GsysDial!status = cmbstatus.ItemData(cmbstatus.ListIndex)
  530. If Label8.Caption <> "" Then
  531. GsysDial!StatusDate = Label8.Caption
  532. End If
  533. If Trim(cmbmin.Text) <> "" Or Val(cmbmin.Text) = 0 Then
  534. GsysDial!MinimumSpeed = Val(cmbmin.Text)
  535. Else
  536. GsysDial!MinimumSpeed = Null
  537. End If
  538. If Trim(cmbmax.Text) <> "" Or Val(cmbmax.Text) = 0 Then
  539. GsysDial!MaximumSpeed = Val(cmbmax.Text)
  540. Else
  541. GsysDial!MaximumSpeed = Null
  542. End If
  543. GsysDial!CityName = txtcity.Text
  544. GsysDial!CountryNumber = dbCmbCty.ItemData(dbCmbCty.ListIndex)
  545. GsysDial!RegionID = cmbRegion.ItemData(cmbRegion.ListIndex) 'Val(lbldesc.Caption)
  546. GsysDial!ScriptID = txtscript.Text
  547. GsysDial!FlipFactor = 0
  548. GsysDial!Flags = result
  549. GsysDial!Comments = txtcomment.Text
  550. GsysDial.Update
  551. If cmbstatus.ItemData(cmbstatus.ListIndex) = 1 Then
  552. 'insert the delta table (production pop)
  553. Set GsysDelta = gsyspb.OpenRecordset("Select * from Delta order by DeltaNum", dbOpenDynaset)
  554. If GsysDelta.RecordCount = 0 Then
  555. deltnum = 1
  556. Else
  557. GsysDelta.MoveLast
  558. deltnum = GsysDelta!deltanum
  559. If deltnum > 6 Then
  560. deltnum = deltnum - 1
  561. End If
  562. End If
  563. For i = 1 To deltnum
  564. deltasql = "Select * from delta where DeltaNum = " & i% & " order by DeltaNum"
  565. Set GsysDelta = gsyspb.OpenRecordset(deltasql, dbOpenDynaset)
  566. addFound = 0 'initialize delta not found
  567. Do While GsysDelta.EOF = False
  568. If GsysDelta!AccessNumberId = Val(txtid.Text) Then
  569. addFound = 1
  570. Exit Do
  571. Else
  572. GsysDelta.MoveNext
  573. End If
  574. Loop
  575. If addFound = 0 Then
  576. GsysDelta.AddNew
  577. GsysDelta!deltanum = i%
  578. GsysDelta!AccessNumberId = txtid.Text
  579. Else
  580. GsysDelta.Edit
  581. End If
  582. GsysDelta!CountryNumber = dbCmbCty.ItemData(dbCmbCty.ListIndex)
  583. GsysDelta!AreaCode = maskArea.Text
  584. GsysDelta!AccessNumber = maskAccNo.Text
  585. If Trim(cmbmin.Text) <> "" Or Val(cmbmin.Text) = 0 Then
  586. GsysDelta!MinimumSpeed = Val(cmbmin.Text)
  587. Else
  588. GsysDelta!MinimumSpeed = Null
  589. End If
  590. If Trim(cmbmax.Text) <> "" Or Val(cmbmax.Text) = 0 Then
  591. GsysDelta!MaximumSpeed = Val(cmbmax.Text)
  592. Else
  593. GsysDelta!MaximumSpeed = Null
  594. End If
  595. GsysDelta!RegionID = cmbRegion.ItemData(cmbRegion.ListIndex)
  596. GsysDelta!CityName = txtcity.Text
  597. GsysDelta!ScriptID = txtscript.Text
  598. GsysDelta!FlipFactor = 0
  599. GsysDelta!Flags = result
  600. GsysDelta.Update
  601. Next i%
  602. End If
  603. Dim itmX As ListItem
  604. Dim strTemp As String
  605. frmMain.PopList.Sorted = False
  606. Set itmX = frmMain.PopList.ListItems.Add()
  607. With itmX
  608. .Text = txtcity.Text
  609. .SubItems(1) = maskArea.Text
  610. .SubItems(2) = maskAccNo.Text
  611. .SubItems(3) = dbCmbCty.Text
  612. .SubItems(4) = cmbRegion.Text
  613. .SubItems(5) = cmbstatus.Text
  614. strTemp = "Key:" & txtid.Text
  615. .Key = strTemp
  616. End With
  617. GsysDial.Close
  618. Set GsysDial = gsyspb.OpenRecordset("Select * from DialUpPort where AccessNumberID = " & txtid.Text, dbOpenSnapshot)
  619. LogPOPAdd GsysDial
  620. GsysDelta.Close
  621. Set GsysDial = Nothing
  622. Set GsysDelta = Nothing
  623. Screen.MousePointer = 0
  624. InsertPOP = 1
  625. Exit Function
  626. ErrTrap:
  627. InsertPOP = 0
  628. Screen.MousePointer = 0
  629. MsgBox LoadResString(6056) & Chr(13) & Chr(13) & Err.Description, vbExclamation
  630. Exit Function
  631. End Function
  632. Function LoadPOPRes()
  633. Dim cRef As Integer
  634. On Error GoTo LoadErr
  635. cRef = 4000
  636. Me.Caption = LoadResString(cRef + 58) & " " & gsCurrentPB
  637. SSTab1.TabCaption(0) = LoadResString(cRef + 38)
  638. SSTab1.TabCaption(1) = LoadResString(cRef + 39)
  639. SSTab1.TabCaption(2) = LoadResString(cRef + 45)
  640. POPLabel.Caption = LoadResString(cRef + 46)
  641. CountryLabel.Caption = LoadResString(cRef + 47)
  642. RegionLabel.Caption = LoadResString(cRef + 48)
  643. AreaLabel.Caption = LoadResString(cRef + 49)
  644. AccessLabel.Caption = LoadResString(cRef + 50)
  645. StatusLabel.Caption = LoadResString(cRef + 51)
  646. ' status list
  647. With cmbstatus
  648. .AddItem gStatusText(1)
  649. .ItemData(.NewIndex) = 1
  650. .AddItem gStatusText(0)
  651. .ItemData(.NewIndex) = 0
  652. End With
  653. ' region list
  654. With cmbRegion
  655. .AddItem gRegionText(0), 0
  656. .ItemData(.NewIndex) = 0
  657. ' .AddItem gRegionText(-1), 1
  658. ' .ItemData(.NewIndex) = -1
  659. End With
  660. FlagFrame.Caption = LoadResString(cRef + 52)
  661. dunLabel.Caption = LoadResString(cRef + 53)
  662. analogFrame.Caption = LoadResString(cRef + 54)
  663. MinLabel.Caption = LoadResString(cRef + 55)
  664. MaxLabel.Caption = LoadResString(cRef + 56)
  665. For cRef = 4080 To 4087
  666. FlagCheck(cRef - 4080).Caption = LoadResString(cRef)
  667. Next
  668. cmdOK.Caption = LoadResString(1002)
  669. cmbclose.Caption = LoadResString(1003)
  670. cmdSave.Caption = LoadResString(1004)
  671. ' set fonts
  672. SetFonts Me
  673. SSTab1.Font.Charset = gfnt.Charset
  674. SSTab1.Font.Name = gfnt.Name
  675. SSTab1.Font.Size = gfnt.Size
  676. On Error GoTo 0
  677. Exit Function
  678. LoadErr:
  679. Exit Function
  680. End Function
  681. Private Sub cmbclose_Click()
  682. Screen.MousePointer = 11
  683. Me.Hide
  684. Unload Me
  685. Screen.MousePointer = 0
  686. End Sub
  687. Private Sub cmbmax_KeyPress(KeyAscii As Integer)
  688. KeyAscii = FilterNumberKey(KeyAscii)
  689. End Sub
  690. Private Sub cmbmin_KeyPress(KeyAscii As Integer)
  691. KeyAscii = FilterNumberKey(KeyAscii)
  692. End Sub
  693. Private Sub cmbstatus_Change()
  694. If cmbstatus.Text <> "" Then
  695. Label8.Caption = Date
  696. Else
  697. Label8.Caption = ""
  698. End If
  699. End Sub
  700. Private Sub cmbstatus_Click()
  701. If cmbstatus.Text <> "" Then
  702. Label8.Caption = Date
  703. Else
  704. Label8.Caption = ""
  705. End If
  706. End Sub
  707. Private Sub cmdOK_Click()
  708. Dim intRC As Integer
  709. On Error Resume Next
  710. Screen.MousePointer = 11
  711. If InsertPOP = 1 Then
  712. Me.Hide
  713. Unload Me
  714. End If
  715. Screen.MousePointer = 0
  716. End Sub
  717. Private Sub cmdSave_Click()
  718. On Error Resume Next
  719. If InsertPOP = 1 Then
  720. 'good insert
  721. txtid.Text = Val(txtid.Text) + 1
  722. txtcity.Text = ""
  723. maskArea.Text = ""
  724. maskAccNo.Text = ""
  725. cmbstatus.ListIndex = -1
  726. SSTab1.Tab = 0
  727. txtcity.SetFocus
  728. End If
  729. On Error GoTo 0
  730. Exit Sub
  731. ErrTrap:
  732. Exit Sub
  733. End Sub
  734. Private Sub Form_Deactivate()
  735. Unload Me
  736. End Sub
  737. Private Sub Form_KeyPress(KeyAscii As Integer)
  738. CheckChar KeyAscii
  739. End Sub
  740. Sub Form_Load()
  741. Dim tempnum As Integer, i As Integer
  742. Dim newnum As Recordset
  743. Dim rsService As Recordset
  744. Dim RS As Recordset
  745. Dim n As Long
  746. Dim bool As Integer
  747. Dim mydesc As String
  748. ReDim bitvaluearray(31) As bitValues
  749. Dim myPos As Integer
  750. On Error GoTo LoadErr
  751. Screen.MousePointer = 11
  752. LoadPOPRes
  753. SSTab1.Tab = 0
  754. CenterForm Me, Screen
  755. Set rsService = gsyspb.OpenRecordset("select * from Configuration", dbOpenSnapshot)
  756. rsService.MoveLast
  757. Set newnum = gsyspb.OpenRecordset("select * from DialUpPort order by AccessNumberId", dbOpenSnapshot)
  758. LoadList dbCmbCty, "Country", "CountryName", "CountryNumber"
  759. LoadList cmbRegion, "Region", "regiondesc", "regionid"
  760. If newnum.RecordCount = 0 Then
  761. tempnum = 0
  762. cmbRegion.Text = gRegionText(0)
  763. n = 0
  764. Else
  765. newnum.MoveLast
  766. tempnum = newnum!AccessNumberId
  767. Set GsysNCty = gsyspb.OpenRecordset("select * from Country where CountryNumber = " & newnum!CountryNumber, dbOpenSnapshot)
  768. dbCmbCty.Text = GsysNCty!countryname
  769. Set GsysNRgn = gsyspb.OpenRecordset("select * from Region where RegionId = " & newnum!RegionID, dbOpenSnapshot)
  770. If GsysNRgn.RecordCount <> 0 Then
  771. cmbRegion = GsysNRgn!RegionDesc
  772. Else
  773. Select Case newnum!RegionID
  774. Case 0, -1
  775. cmbRegion = gRegionText(newnum!RegionID)
  776. Case Else
  777. cmbRegion = gRegionText(0)
  778. End Select
  779. End If
  780. If IsNull(newnum!ScriptID) Then
  781. txtscript.Text = ""
  782. Else
  783. txtscript.Text = newnum!ScriptID
  784. End If
  785. If IsNull(newnum!MinimumSpeed) Or newnum!MinimumSpeed = 0 Then
  786. cmbmin.Text = ""
  787. Else
  788. cmbmin.Text = newnum!MinimumSpeed
  789. End If
  790. If IsNull(newnum!MaximumSpeed) Or newnum!MaximumSpeed = 0 Then
  791. cmbmax.Text = ""
  792. Else
  793. cmbmax.Text = newnum!MaximumSpeed
  794. End If
  795. n = newnum!Flags
  796. End If
  797. tempnum = tempnum + 1
  798. txtid.Text = tempnum
  799. ' make this a function: intRC = SetFlagBoxes(<flagcheck control array>)
  800. 'intRC = SetFlagBoxes(n, FlagCheck)
  801. Set RS = gsyspb.OpenRecordset("select * from bitflag order by bit, value", dbOpenSnapshot)
  802. RS.MoveFirst
  803. While Not RS.EOF
  804. bitvaluearray(RS!Bit).desc(RS!Value) = RS!desc
  805. RS.MoveNext
  806. Wend
  807. For i = 0 To 7
  808. bool = isBitSet(n, i)
  809. mydesc = bitvaluearray(i).desc(bool)
  810. 'handle the oddities that i introduced with the old
  811. ' list format, i.e. some flags are NOT by default.
  812. Select Case i
  813. Case 0, 2, 3, 5
  814. FlagCheck(i).Value = Abs(bool - 1)
  815. Case Else
  816. FlagCheck(i).Value = bool
  817. End Select
  818. Next i
  819. RS.Close
  820. rsService.Close
  821. newnum.Close
  822. Screen.MousePointer = 0
  823. Exit Sub
  824. LoadErr:
  825. Screen.MousePointer = 0
  826. Exit Sub
  827. End Sub
  828. Private Sub Form_Unload(Cancel As Integer)
  829. Set GsysNCty = Nothing
  830. Set GsysNRgn = Nothing
  831. End Sub
  832. Private Sub maskaccno_GotFocus()
  833. SelectText maskAccNo
  834. End Sub
  835. Private Sub maskaccno_KeyPress(KeyAscii As Integer)
  836. Select Case KeyAscii
  837. '0-9 A-Z a-z * # Bkspc Hyphen Space ctrl-C ctrl-V
  838. Case 48 To 57, 65 To 90, 97 To 122, 42, 35, 8, 45, 32, 3, 22
  839. Case Else
  840. KeyAscii = 0
  841. Beep
  842. End Select
  843. End Sub
  844. Private Sub maskarea_GotFocus()
  845. SelectText maskArea
  846. End Sub
  847. Private Sub maskarea_KeyPress(KeyAscii As Integer)
  848. Select Case KeyAscii
  849. '0-9 A-Z a-z * # Bkspc Hyphen Space ctrl-C ctrl-V
  850. Case 48 To 57, 65 To 90, 97 To 122, 42, 35, 8, 45, 32, 3, 22
  851. Case Else
  852. KeyAscii = 0
  853. Beep
  854. End Select
  855. End Sub
  856. Private Sub picContainer_Click(index As Integer)
  857. picContainer(index).Enabled = True
  858. End Sub
  859. Private Sub SSTab1_Click(PreviousTab As Integer)
  860. picContainer(PreviousTab).Visible = False
  861. picContainer(SSTab1.Tab).Visible = True
  862. End Sub
  863. Private Sub txtcity_GotFocus()
  864. SelectText txtcity
  865. End Sub
  866. Private Sub txtcity_KeyPress(KeyAscii As Integer)
  867. Select Case KeyAscii
  868. Case 44 ',
  869. KeyAscii = 0
  870. Beep
  871. End Select
  872. End Sub
  873. Private Sub txtid_KeyDown(KeyCode As Integer, Shift As Integer)
  874. KeyCode = 0
  875. End Sub
  876. Private Sub txtid_KeyPress(KeyAscii As Integer)
  877. KeyAscii = 0
  878. End Sub
  879. Private Sub LoadList(list As Control, sTableName As String, sName As String, sID As String)
  880. Dim RS As Recordset
  881. On Error GoTo LoadErr
  882. 'list.Clear
  883. Set RS = gsyspb.OpenRecordset("SELECT " & sName & "," & sID & " FROM " & sTableName & " order by " & sName, dbOpenSnapshot)
  884. While Not RS.EOF
  885. list.AddItem RS(sName)
  886. list.ItemData(list.NewIndex) = RS(sID)
  887. RS.MoveNext
  888. Wend
  889. RS.Close
  890. On Error GoTo 0
  891. Exit Sub
  892. LoadErr:
  893. Exit Sub
  894. End Sub
  895. Private Sub txtscript_GotFocus()
  896. SelectText txtscript
  897. End Sub
  898. Private Sub txtscript_KeyPress(KeyAscii As Integer)
  899. Select Case KeyAscii
  900. Case 44
  901. KeyAscii = 0
  902. Beep
  903. End Select
  904. End Sub