CHNGDB.FRM
上传用户:bangxh
上传日期:2007-01-31
资源大小:42235k
文件大小:2k
源码类别:

Windows编程

开发平台:

Visual C++

  1. VERSION 2.00
  2. Begin Form CHNGDB 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Change Database"
  6.    ForeColor       =   &H00000000&
  7.    Height          =   2160
  8.    Left            =   2895
  9.    MaxButton       =   0   'False
  10.    MinButton       =   0   'False
  11.    ScaleHeight     =   1755
  12.    ScaleWidth      =   5640
  13.    Top             =   3150
  14.    Width           =   5760
  15.    Begin CommandButton CANCEL_BUTTON 
  16.       BackColor       =   &H00C0C0C0&
  17.       Cancel          =   -1  'True
  18.       Caption         =   "Cancel"
  19.       Height          =   480
  20.       Left            =   3240
  21.       TabIndex        =   3
  22.       Top             =   1200
  23.       Width           =   1320
  24.    End
  25.    Begin CommandButton OK_BUTTON 
  26.       BackColor       =   &H00C0C0C0&
  27.       Caption         =   "OK"
  28.       Default         =   -1  'True
  29.       Height          =   480
  30.       Left            =   1080
  31.       TabIndex        =   2
  32.       Top             =   1200
  33.       Width           =   1320
  34.    End
  35.    Begin ComboBox DBNAME_COMBO 
  36.       BackColor       =   &H00FFFFFF&
  37.       ForeColor       =   &H00000000&
  38.       Height          =   300
  39.       Left            =   2040
  40.       TabIndex        =   1
  41.       Text            =   "Combo1"
  42.       Top             =   360
  43.       Width           =   3240
  44.    End
  45.    Begin Label Label1 
  46.       BackColor       =   &H00FFFFFF&
  47.       Caption         =   "Database Name:"
  48.       ForeColor       =   &H00000000&
  49.       Height          =   240
  50.       Left            =   240
  51.       TabIndex        =   0
  52.       Top             =   480
  53.       Width           =   1560
  54.    End
  55. End
  56. '$INCLUDE: 'VBQUERY.BI'
  57. '$INCLUDE: 'VBDSQL.BI'
  58. Sub CANCEL_BUTTON_Click ()
  59. Unload Chngdb
  60. End Sub
  61. Sub Form_Load ()
  62. Result% = GetDatabases(DBNAME_COMBO)
  63. If Result% = FAIL% Then Unload Chngdb
  64. End Sub
  65. Sub OK_BUTTON_Click ()
  66. newname$ = DBNAME_COMBO.Text
  67. If SqlUse(SqlConn, newname$) = SUCCEED% Then
  68. DatabaseName$ = DBNAME_COMBO.Text
  69. ChangePrimaryWindowCaption
  70. SqlStatus = SUCCEED
  71. Else
  72. SqlStatus = FAIL
  73. End If
  74. Unload Chngdb
  75. End Sub