?? frmfile.frm
字號:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "ComDlg32.OCX"
Begin VB.Form frmFile
Caption = "文件傳送"
ClientHeight = 4230
ClientLeft = 60
ClientTop = 345
ClientWidth = 8820
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 4230
ScaleWidth = 8820
StartUpPosition = 2 '屏幕中心
Begin MSComDlg.CommonDialog CommonDialog1
Left = 6255
Top = 120
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.CommandButton cmdFile
Caption = "瀏覽文件"
Height = 330
Left = 7605
TabIndex = 16
Top = 1290
Width = 1080
End
Begin VB.TextBox txtFile
Height = 330
Left = 1020
TabIndex = 15
Top = 1290
Width = 6555
End
Begin VB.TextBox txtSubject
Height = 330
Left = 1020
TabIndex = 12
Top = 930
Width = 7650
End
Begin VB.CommandButton cmdEnd
Caption = "退出"
Height = 345
Left = 7500
TabIndex = 2
Top = 3795
Width = 1110
End
Begin VB.ComboBox Combo1
Height = 300
Left = 1020
Style = 2 'Dropdown List
TabIndex = 5
Top = 270
Width = 1800
End
Begin VB.ComboBox Combo2
Height = 300
Left = 1020
Style = 2 'Dropdown List
TabIndex = 4
Top = 600
Width = 1800
End
Begin VB.CommandButton cmdSave
Caption = "傳送文件"
Height = 345
Left = 6405
TabIndex = 3
Top = 3795
Width = 1110
End
Begin VB.TextBox txtMemo
Height = 1740
Left = 1020
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 1650
Width = 7650
End
Begin VB.TextBox txtName
Alignment = 2 'Center
Enabled = 0 'False
Height = 285
Left = 1005
TabIndex = 0
Top = 3840
Width = 1590
End
Begin MSAdodcLib.Adodc adoEmployee
Height = 330
Left = 3630
Top = 615
Visible = 0 'False
Width = 2355
_ExtentX = 4154
_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 = "adoEmployee"
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 MSAdodcLib.Adodc adoDept
Height = 330
Left = 3630
Top = 255
Visible = 0 'False
Width = 2355
_ExtentX = 4154
_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 = "adoDept"
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 MSComCtl2.DTPicker DTPicker1
Height = 285
Left = 7335
TabIndex = 6
Top = 585
Width = 1320
_ExtentX = 2328
_ExtentY = 503
_Version = 393216
Format = 171835393
CurrentDate = 38713
End
Begin VB.Label Label7
AutoSize = -1 'True
Caption = "上傳文件:"
Height = 180
Left = 75
TabIndex = 14
Top = 1365
Width = 900
End
Begin VB.Label Label6
AutoSize = -1 'True
Caption = "文件描述:"
Height = 180
Left = 75
TabIndex = 13
Top = 1815
Width = 900
End
Begin VB.Label Label5
AutoSize = -1 'True
Caption = "文件主題:"
Height = 180
Left = 75
TabIndex = 11
Top = 990
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "接收部門:"
Height = 180
Left = 75
TabIndex = 10
Top = 315
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "接收人:"
Height = 180
Left = 75
TabIndex = 9
Top = 645
Width = 720
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "日期:"
Height = 180
Left = 6735
TabIndex = 8
Top = 660
Width = 540
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "發布人:"
Height = 180
Left = 165
TabIndex = 7
Top = 3900
Width = 720
End
End
Attribute VB_Name = "frmFile"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim fileName As String
'////////////////////////////////////////////////////////////////////
Private Sub cmdEnd_Click()
Unload Me
End Sub
Private Sub cmdFile_Click()
CommonDialog1.ShowOpen
txtFile.Text = CommonDialog1.fileName
fileName = CommonDialog1.FileTitle
End Sub
Private Sub cmdSave_Click()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim mst As ADODB.Stream
Me.MousePointer = 11
Set cn = New ADODB.Connection
cn.ConnectionString = "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_OA;Data Source=MRZYT"
cn.Open
Set rs = New ADODB.Recordset
rs.Open "select * from tbOA_file", cn, adOpenStatic, adLockOptimistic
Set mst = New ADODB.Stream
mst.Type = adTypeBinary
mst.Open
mst.LoadFromFile txtFile.Text
rs.AddNew
rs.Fields(1).Value = txtSubject.Text
rs.Fields(2).Value = txtMemo.Text
rs.Fields(3).Value = txtName.Text
rs.Fields(4).Value = Combo1.Text
rs.Fields(5).Value = Combo2.Text
rs.Fields(6).Value = DTPicker1.Value
rs.Fields(7).Value = mst.Read
rs.Fields(8).Value = fileName
rs.Update
rs.Close
cn.Close
Me.MousePointer = 0
MsgBox "文件傳送成功!", vbInformation
End Sub
Private Sub Combo1_Click()
Combo2.Clear
adoEmployee.ConnectionString = PublicStr
adoEmployee.RecordSource = "select * from tbOA_employee where e_dept='" & Combo1.Text & "'"
adoEmployee.Refresh
For i = 0 To adoEmployee.Recordset.RecordCount - 1
Combo2.AddItem adoEmployee.Recordset.Fields(1).Value
adoEmployee.Recordset.MoveNext
Next i
End Sub
Private Sub Form_Load()
adoDept.ConnectionString = PublicStr
adoDept.RecordSource = "select * from tbOA_dept"
adoDept.Refresh
For i = 0 To adoDept.Recordset.RecordCount - 1
Combo1.AddItem adoDept.Recordset.Fields(1).Value
adoDept.Recordset.MoveNext
Next i
txtName.Text = Mid(frm_mainBefore.StatusBar1.Panels(1).Text, 6, Len(frm_mainBefore.StatusBar1.Panels(1).Text) - 5)
DTPicker1.Value = Date
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -