📄 form4.frm
字号:
VERSION 5.00
Object = "{90F3D7B3-92E7-44BA-B444-6A8E2A3BC375}#1.0#0"; "actskin4.ocx"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{9A226D6F-2658-4445-8D35-5C19D42676FE}#1.0#0"; "BSE.ocx"
Begin VB.Form Form4
AutoRedraw = -1 'True
Caption = "数据库数据修改用"
ClientHeight = 10830
ClientLeft = 60
ClientTop = 450
ClientWidth = 15165
LinkTopic = "Form4"
ScaleHeight = 10830
ScaleWidth = 15165
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame2
Caption = "所选表字段"
Height = 8895
Left = 120
TabIndex = 9
Top = 1320
Width = 1695
Begin VB.ListBox List1
BackColor = &H00E0E0E0&
Height = 8520
ItemData = "Form4.frx":0000
Left = 120
List = "Form4.frx":0002
TabIndex = 10
Top = 240
Width = 1455
End
End
Begin BSE_Engine.BSE BSE1
Left = 3000
Top = 7560
_ExtentX = 6588
_ExtentY = 1085
End
Begin ACTIVESKINLibCtl.Skin Skin1
Left = 1560
OleObjectBlob = "Form4.frx":0004
Top = 4320
End
Begin MSComctlLib.StatusBar StatusBar1
Align = 2 'Align Bottom
Height = 495
Left = 0
TabIndex = 8
Top = 10335
Width = 15165
_ExtentX = 26749
_ExtentY = 873
_Version = 393216
BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
NumPanels = 1
BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
EndProperty
EndProperty
End
Begin VB.Frame Frame1
Height = 975
Left = 240
TabIndex = 3
Top = 240
Width = 11535
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3720
TabIndex = 7
ToolTipText = "按字段+条件+内容的方式填写如果有多个条件用And或or等,日期期间用:日期字段+Between+'日期'+and+'日期';"
Top = 360
Width = 7575
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel3
Height = 255
Left = 3120
OleObjectBlob = "Form4.frx":0238
TabIndex = 6
Top = 480
Width = 615
End
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1200
TabIndex = 5
Text = "Combo1"
Top = 360
Width = 1575
End
Begin ACTIVESKINLibCtl.SkinLabel SkinLabel1
Height = 375
Left = 240
OleObjectBlob = "Form4.frx":029C
TabIndex = 4
Top = 480
Width = 975
End
End
Begin VB.CommandButton Command1
Caption = "信息查询"
Height = 855
Left = 12000
Picture = "Form4.frx":0304
Style = 1 'Graphical
TabIndex = 2
Top = 360
Width = 1335
End
Begin VB.CommandButton Command2
Caption = "确认修改"
Height = 855
Left = 13560
Picture = "Form4.frx":0BCE
Style = 1 'Graphical
TabIndex = 1
Top = 360
Width = 1335
End
Begin MSDataGridLib.DataGrid DataGrid1
Height = 8775
Left = 1920
TabIndex = 0
Top = 1440
Width = 13095
_ExtentX = 23098
_ExtentY = 15478
_Version = 393216
AllowArrows = -1 'True
HeadLines = 1
RowHeight = 15
WrapCellPointer = -1 'True
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
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
BeginProperty Column00
EndProperty
BeginProperty Column01
EndProperty
EndProperty
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 3360
Top = 10080
Visible = 0 'False
Width = 2895
_ExtentX = 5106
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 3
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "DSN=slmis"
OLEDBString = ""
OLEDBFile = ""
DataSourceName = "slmis"
OtherAttributes = ""
UserName = "slmis"
Password = "dfwl111"
RecordSource = "select * from lcw"
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 = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim p As String
Private Sub Combo1_LostFocus()
Adodc1.RecordSource = "select * from " & Combo1.Text
Adodc1.Refresh
For Each fld In Adodc1.Recordset.Fields
List1.AddItem fld.Name
Next
End Sub
Private Sub Command1_Click()
If Text1.Text <> "" Then
Adodc1.RecordSource = "select * from " & Combo1.Text & " where " & Text1.Text
Adodc1.Refresh
Else
Adodc1.RecordSource = "select * from " & Combo1.Text
End If
Set DataGrid1.DataSource = Adodc1
End Sub
Private Sub Command2_Click()
If MsgBox("真的要修改数据吗?", vbInformation + vbOKCancel, "系统提示") = vbOK Then
Adodc1.Recordset.Update
Adodc1.Refresh
Set DataGrid1.DataSource = Adodc1
End If
End Sub
Private Sub Form_Load()
Skin1.LoadSkin App.Path + "\Skins\0.skn"
Skin1.ApplySkin Me.hWnd
BSE1.SchemeStyle = 2
BSE1.EndSubClassing
BSE1.InitSubClassing
Dim adoCN As New adodb.Connection '定义数据库的连接存放数据和代码Dim rstSchema
Dim strCnn As New adodb.Recordset
str1 = "Provider=MSDASQL.1;Password=dfwl111;Persist Security Info=True;User ID=slmis;Data Source=slmis;Initial Catalog=slmis"
adoCN.Open str1
Set rstSchema = adoCN.OpenSchema(adSchemaTables)
Do Until rstSchema.EOF
If Trim(rstSchema!TABLE_TYPE) = "TABLE" Then
tablename = Trim(rstSchema!TABLE_NAME)
Combo1.AddItem tablename
Combo1.Text = Combo1.List(1)
End If
rstSchema.MoveNext
Loop
rstSchema.Close
adoCN.Close
End Sub
Private Sub Form_Unload(Cancel As Integer)
Form1.Show
Unload Form4
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -