?? 數據選擇.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form 數據選擇
BackColor = &H00FFFFC0&
BorderStyle = 3 'Fixed Dialog
Caption = "數據選擇"
ClientHeight = 4800
ClientLeft = 2760
ClientTop = 3750
ClientWidth = 5940
Icon = "數據選擇.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 4800
ScaleWidth = 5940
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin MSDataGridLib.DataGrid DataGrid1
Height = 3915
Left = 120
TabIndex = 2
Top = 180
Width = 5715
_ExtentX = 10081
_ExtentY = 6906
_Version = 393216
AllowUpdate = 0 'False
ForeColor = 0
HeadLines = 1
RowHeight = 15
BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 9.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ColumnCount = 2
BeginProperty Column00
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
BeginProperty Column01
DataField = ""
Caption = ""
BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
Type = 0
Format = ""
HaveTrueFalseNull= 0
FirstDayOfWeek = 0
FirstWeekOfYear = 0
LCID = 2052
SubFormatType = 0
EndProperty
EndProperty
SplitCount = 1
BeginProperty Split0
MarqueeStyle = 3
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin VB.CommandButton CancelButton
BackColor = &H00FFFFC0&
Caption = "取消"
Height = 375
Left = 3720
Style = 1 'Graphical
TabIndex = 1
Top = 4320
Width = 1215
End
Begin VB.CommandButton OKButton
BackColor = &H00FFFFC0&
Caption = "確定"
Height = 375
Left = 1200
Style = 1 'Graphical
TabIndex = 0
Top = 4320
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 120
Top = 4080
Width = 4575
_ExtentX = 8070
_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
End
Attribute VB_Name = "數據選擇"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Public title As String
Public result1 As String
Public result2 As String
Option Explicit
Private Sub CancelButton_Click()
result1 = ""
result2 = ""
Unload Me
End Sub
Private Sub Form_Load()
Adodc1.Visible = False
End Sub
Private Sub Form_Resize()
On Error Resume Next
Adodc1.ConnectionString = DataConnectString
Set DataGrid1.DataSource = Adodc1
Adodc1.Refresh
Me.caption = title
Dim d As Integer
Dim inttype As Integer
If DataGrid1.Columns.count <= 2 Then
d = 600
Else
d = 50
End If
Dim i As Integer
For i = 0 To DataGrid1.Columns.count - 1
DataGrid1.Columns(i).Width = Len(DataGrid1.Columns(i).caption) * d
inttype = Adodc1.Recordset.Fields(i).Type
Select Case inttype
Case dbBoolean
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 500
Case dbByte
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 500
Case dbInteger
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 500
Case dbLong
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 500
Case dbCurrency
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 1000
Case dbSingle
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 600
Case dbDouble
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 700
Case dbDate
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 800
Case dbText
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 1000
Case dbLongBinary
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 1000
Case dbMemo
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 1000
Case dbGUID
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 1000
Case Else
DataGrid1.Columns(i).Width = DataGrid1.Columns(i).Width + 1000
End Select
Next
End Sub
Private Sub OKButton_Click()
On Error Resume Next
result1 = DataGrid1.Columns(0).Text
result2 = DataGrid1.Columns(1).Text
Unload Me
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -