home *** CD-ROM | disk | FTP | other *** search
/ An Introduction to Progr…l Basic 6.0 (4th Edition) / An Introduction to Programming using Visual Basic 6.0.iso / PROGRAMS / CH12 / 12-3-1.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1998-11-02  |  2.4 KB  |  72 lines

  1. VERSION 5.00
  2. Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
  3. Begin VB.Form frm12_3_1 
  4.    Caption         =   "Megacities"
  5.    ClientHeight    =   3615
  6.    ClientLeft      =   1095
  7.    ClientTop       =   1515
  8.    ClientWidth     =   5115
  9.    LinkTopic       =   "Form1"
  10.    PaletteMode     =   1  'UseZOrder
  11.    ScaleHeight     =   3615
  12.    ScaleWidth      =   5115
  13.    Begin MSFlexGridLib.MSFlexGrid msgCities 
  14.       Bindings        =   "12-3-1.frx":0000
  15.       Height          =   2895
  16.       Left            =   600
  17.       TabIndex        =   1
  18.       Top             =   120
  19.       Width           =   4215
  20.       _ExtentX        =   7435
  21.       _ExtentY        =   5106
  22.       _Version        =   393216
  23.       FixedCols       =   0
  24.    End
  25.    Begin VB.Data datCities 
  26.       Caption         =   "Large World Cities"
  27.       Connect         =   "Access"
  28.       DatabaseName    =   "Megacty2.mdb"
  29.       DefaultCursorType=   0  'DefaultCursor
  30.       DefaultType     =   2  'UseODBC
  31.       Exclusive       =   0   'False
  32.       Height          =   390
  33.       Left            =   120
  34.       Options         =   0
  35.       ReadOnly        =   0   'False
  36.       RecordsetType   =   1  'Dynaset
  37.       RecordSource    =   "Cities"
  38.       Top             =   3120
  39.       Width           =   2412
  40.    End
  41.    Begin VB.CommandButton cmdShow 
  42.       Caption         =   "Show City, Country, Currency"
  43.       Height          =   375
  44.       Left            =   2640
  45.       TabIndex        =   0
  46.       Top             =   3120
  47.       Width           =   2412
  48.    End
  49. Attribute VB_Name = "frm12_3_1"
  50. Attribute VB_GlobalNameSpace = False
  51. Attribute VB_Creatable = False
  52. Attribute VB_PredeclaredId = True
  53. Attribute VB_Exposed = False
  54. Private Sub cmdShow_Click()
  55.   If cmdShow.Caption = "Show City, Country, Currency" Then
  56.     'Join the two tables and display cities, countries, and currency
  57.     datCities.RecordSource = "SELECT city, Cities.country, currency FROM " & _
  58.       "Cities INNER JOIN Countries ON Countries.country = Cities.country " & _
  59.       "ORDER BY city"
  60.     datCities.Refresh
  61.     cmdShow.Caption = "Show City, Country, Populations"
  62.   Else
  63.     datCities.RecordSource = "cities"
  64.     datCities.Refresh
  65.     cmdShow.Caption = "Show City, Country, Currency"
  66.   End If
  67. End Sub
  68. Private Sub Form_Load()
  69.   datCities.DatabaseName = App.Path & "\megacty2.mdb"
  70.   msgCities.ColWidth(0) = 1000   'Widen the first column slightly
  71. End Sub
  72.