📄 datamain.frm
字号:
VERSION 5.00
Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "Vsflex7.ocx"
Begin VB.Form DataMain
BorderStyle = 3 'Fixed Dialog
Caption = "选择导出表"
ClientHeight = 8160
ClientLeft = 45
ClientTop = 330
ClientWidth = 5175
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 8160
ScaleWidth = 5175
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton SelAll
Caption = "选择全部"
Height = 375
Left = 1320
TabIndex = 6
Top = 7080
Width = 975
End
Begin VB.CommandButton Exit
Caption = "取消"
Height = 375
Left = 2880
TabIndex = 5
Top = 7680
Width = 1095
End
Begin VB.CommandButton Start
Caption = "导出"
Height = 375
Left = 1080
TabIndex = 4
Top = 7680
Width = 1095
End
Begin VB.Frame Frame2
Height = 6855
Left = 120
TabIndex = 2
Top = 720
Width = 4935
Begin VB.CommandButton SelNothing
Caption = "取消全部"
Height = 375
Left = 2640
TabIndex = 7
Top = 6360
Width = 975
End
Begin VSFlex7Ctl.VSFlexGrid vsGrid
Height = 6015
Left = 120
TabIndex = 3
TabStop = 0 'False
Top = 240
Width = 4695
_cx = 8281
_cy = 10610
_ConvInfo = 1
Appearance = 1
BorderStyle = 1
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MousePointer = 0
BackColor = -2147483643
ForeColor = -2147483640
BackColorFixed = -2147483633
ForeColorFixed = -2147483630
BackColorSel = -2147483635
ForeColorSel = -2147483634
BackColorBkg = -2147483643
BackColorAlternate= -2147483643
GridColor = -2147483633
GridColorFixed = -2147483632
TreeColor = -2147483632
FloodColor = 192
SheetBorder = -2147483643
FocusRect = 0
HighLight = 0
AllowSelection = 0 'False
AllowBigSelection= 0 'False
AllowUserResizing= 1
SelectionMode = 1
GridLines = 1
GridLinesFixed = 2
GridLineWidth = 1
Rows = 1
Cols = 2
FixedRows = 1
FixedCols = 0
RowHeightMin = 0
RowHeightMax = 0
ColWidthMin = 0
ColWidthMax = 0
ExtendLastCol = -1 'True
FormatString = $"DataMain.frx":0000
ScrollTrack = 0 'False
ScrollBars = 3
ScrollTips = 0 'False
MergeCells = 3
MergeCompare = 2
AutoResize = -1 'True
AutoSizeMode = 0
AutoSearch = 0
AutoSearchDelay = 2
MultiTotals = -1 'True
SubtotalPosition= 1
OutlineBar = 0
OutlineCol = 0
Ellipsis = 0
ExplorerBar = 5
PicturesOver = 0 'False
FillStyle = 0
RightToLeft = 0 'False
PictureType = 0
TabBehavior = 0
OwnerDraw = 0
Editable = 2
ShowComboButton = -1 'True
WordWrap = 0 'False
TextStyle = 0
TextStyleFixed = 0
OleDragMode = 0
OleDropMode = 0
DataMode = 0
VirtualData = -1 'True
DataMember = ""
ComboSearch = 3
AutoSizeMouse = -1 'True
FrozenRows = 0
FrozenCols = 0
AllowUserFreezing= 0
BackColorFrozen = 0
ForeColorFrozen = 0
WallPaperAlignment= 9
End
End
Begin VB.Frame Frame1
Height = 735
Left = 120
TabIndex = 0
Top = 120
Width = 4935
Begin VB.Label Label1
Caption = "请选择需要导出的表名"
BeginProperty Font
Name = "MS Sans Serif"
Size = 13.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 1
Top = 240
Width = 3255
End
End
End
Attribute VB_Name = "DataMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Exit_Click()
End
End Sub
Private Sub Form_Load()
Dim str As String
Dim rs As New Recordset
Dim I As Integer
Dim temp As String
str = "select * from sysobjects WHERE (xtype = 'U') AND (name <> 'dtproperties')"
Set rs = conn.Execute(str)
vsGrid.Rows = rs.RecordCount + 1
For I = 1 To rs.RecordCount
vsGrid.TextMatrix(I, 0) = Trim(rs("name") & "")
vsGrid.Cell(flexcpChecked, I, 1) = flexUnchecked
vsGrid.Cell(flexcpPictureAlignment, I, 1) = flexAlignCenterCenter
rs.MoveNext
Next I
End Sub
Private Sub SelAll_Click()
Dim I As Integer
Me.MousePointer = vbHourglass
For I = 1 To vsGrid.Rows - 1
If vsGrid.MergeRow(I) = False Then
vsGrid.Cell(flexcpChecked, I, 1) = flexChecked
End If
Next I
Me.MousePointer = vbDefault
End Sub
Private Sub SelNothing_Click()
Dim I As Integer
Me.MousePointer = vbHourglass
For I = 1 To vsGrid.Rows - 1
If vsGrid.MergeRow(I) = False Then
vsGrid.Cell(flexcpChecked, I, 1) = flexUnchecked
End If
Next I
Me.MousePointer = vbDefault
End Sub
Private Sub Start_Click()
Dim M As Integer
Dim sql As String
Dim back As String
Dim rs As New ADODB.Recordset
sql = "select * from W_User"
Set rs = conn.Execute(sql)
While Not rs.EOF
back = ""
back = "insert into T_Download"
For M = 0 To rs.Fields.Count - 1
back = back & rs.Fields.Item(I).Name
If I < rs.Fields.Count - 1 Then back = back & ","
Next
back = back & ") values("
For M = 0 To rs.Fields.Count - 1
back = back & "'" & rs.Fields.Item(I).Value & "'"
If I < rs.Fields.Count - 1 Then back = back & ","
Next
back = back & ")"
rs.MoveNext
Wend
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -