form16.frm

来自「一个商业软件的源码」· FRM 代码 · 共 203 行

FRM
203
字号
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{69958DD9-23E5-11D6-ACD7-0050BAC05F28}#12.0#0"; "CurtButton.ocx"
Begin VB.Form Form16 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Form16"
   ClientHeight    =   4620
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   6855
   LinkTopic       =   "Form16"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4620
   ScaleWidth      =   6855
   StartUpPosition =   3  '窗口缺省
   Begin CurtButton多风格按钮控件.CurtButton CurtButton2 
      Height          =   375
      Left            =   5280
      TabIndex        =   4
      Top             =   3960
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   661
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Picture         =   "Form16.frx":0000
      Caption         =   "确定(&E)"
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   330
      Left            =   1920
      Top             =   3960
      Width           =   1200
      _ExtentX        =   2117
      _ExtentY        =   582
      ConnectMode     =   0
      CursorLocation  =   3
      IsolationLevel  =   -1
      ConnectionTimeout=   15
      CommandTimeout  =   30
      CursorType      =   3
      LockType        =   3
      CommandType     =   8
      CursorOptions   =   0
      CacheSize       =   50
      MaxRecords      =   0
      BOFAction       =   0
      EOFAction       =   0
      ConnectStringType=   1
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   ""
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   ""
      OtherAttributes =   ""
      UserName        =   ""
      Password        =   ""
      RecordSource    =   ""
      Caption         =   "Adodc1"
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      _Version        =   393216
   End
   Begin CurtButton多风格按钮控件.CurtButton CurtButton1 
      Height          =   375
      Left            =   3840
      TabIndex        =   3
      Top             =   3960
      Width           =   1335
      _ExtentX        =   2355
      _ExtentY        =   661
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "宋体"
         Size            =   9
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Picture         =   "Form16.frx":001C
      Caption         =   "清空(&C)"
   End
   Begin VB.ListBox List3 
      Height          =   3120
      ItemData        =   "Form16.frx":0038
      Left            =   4440
      List            =   "Form16.frx":003A
      TabIndex        =   2
      Top             =   360
      Width           =   2055
   End
   Begin VB.ListBox List2 
      Height          =   3120
      ItemData        =   "Form16.frx":003C
      Left            =   2040
      List            =   "Form16.frx":003E
      TabIndex        =   1
      Top             =   360
      Width           =   2295
   End
   Begin VB.ListBox List1 
      Height          =   3120
      ItemData        =   "Form16.frx":0040
      Left            =   120
      List            =   "Form16.frx":0042
      MultiSelect     =   1  'Simple
      TabIndex        =   0
      Top             =   360
      Width           =   1815
   End
End
Attribute VB_Name = "Form16"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub CurtButton1_Click()
List2.Clear
List3.Clear
f16s = ""
f16t1 = ""
f16t2 = ""
End Sub

Private Sub CurtButton2_Click()
If List2.Text <> "" And List3.Text <> "" Then
f16s = "(" & List2.Text & "=" & List3.Text & ")"
Form15.List1.Clear
Form15.List1.AddItem f16t1
Form15.List1.AddItem f16t2
End If
Unload Me
End Sub

Private Sub Form_Load()

Dim rstSchema As ADODB.Recordset
  Set rstSchema = cnnado.OpenSchema(adSchemaTables)
  Do Until rstSchema.EOF
  
  If rstSchema!table_type = "TABLE" Then
             List1.AddItem rstSchema!TABLE_NAME
             rstSchema.MoveNext
             Else
             rstSchema.MoveNext
             End If
        Loop
          
        '   clean   up
        rstSchema.Close
        
        Set rstSchema = Nothing
        Set Cnxn = Nothing
f16t1 = ""
f16t2 = ""
f16s = ""
End Sub

Private Sub List1_Click()
Adodc1.ConnectionString = cnnado.ConnectionString
If f16t1 <> "" Then
If f16t2 = "" Then
f16t2 = List1.Text
Adodc1.RecordSource = "select * from " & f16t2
Adodc1.Refresh
i = Adodc1.Recordset.Fields.Count - 1
For J = 0 To i
List3.AddItem f16t2 & "." & Adodc1.Recordset.Fields(J).name, J
Next J
End If
Else
f16t1 = List1.Text
Adodc1.RecordSource = "select * from " & f16t1
Adodc1.Refresh
i = Adodc1.Recordset.Fields.Count - 1
For J = 0 To i
List2.AddItem f16t1 & "." & Adodc1.Recordset.Fields(J).name, J
Next J
End If
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?