📄 form2.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 Form2
Caption = "Form2"
ClientHeight = 6930
ClientLeft = 165
ClientTop = 855
ClientWidth = 9660
LinkTopic = "Form2"
ScaleHeight = 6930
ScaleWidth = 9660
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Height = 735
Left = 8160
TabIndex = 2
Text = "Text1"
Top = 1200
Visible = 0 'False
Width = 855
End
Begin VB.CommandButton Command1
Caption = "返回上一页"
Height = 855
Left = 6360
TabIndex = 1
Top = 5760
Width = 1215
End
Begin MSAdodcLib.Adodc Adodc1
Height = 375
Left = 240
Top = 6000
Width = 1455
_ExtentX = 2566
_ExtentY = 661
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 MSDataGridLib.DataGrid DataGrid1
Height = 5295
Left = 480
TabIndex = 0
Top = 120
Width = 7095
_ExtentX = 12515
_ExtentY = 9340
_Version = 393216
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
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 VB.Menu n
Caption = "选择表"
Begin VB.Menu js
Caption = "教师表"
Index = 0
End
Begin VB.Menu xm
Caption = "项目表"
Index = 1
End
Begin VB.Menu xmcy
Caption = "项目成员"
Index = 2
End
Begin VB.Menu xmly
Caption = "项目来源"
Index = 3
End
Begin VB.Menu lw
Caption = "论文表"
Index = 4
End
Begin VB.Menu kyjl
Caption = "科研奖励表"
Index = 5
End
Begin VB.Menu kyjlcy
Caption = "科研奖励成员表"
Index = 6
End
Begin VB.Menu jxjl
Caption = "教学奖励表"
Index = 7
End
Begin VB.Menu jxjlcy
Caption = "教学奖励成员表"
Index = 8
End
Begin VB.Menu shry
Caption = "社会荣誉"
Index = 9
End
Begin VB.Menu fmzl
Caption = "发明专利"
Index = 10
End
End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim cn As New Connection
Dim rs As New Recordset
Dim d As Integer
Private Sub Command1_Click()
If d <> 0 Then
d = 0
rs.Close
Form2.Visible = False
Form1.Show
Else
Form2.Visible = False
Form1.Show
End If
End Sub
Private Sub fmzl_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 发明专利 where" & " " & b
If a = "admin" Then
rs.Open "select * from 发明专利", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub Form_Load()
Dim str As String
str = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=科研管理信息系统"
cn.CursorLocation = adUseClient
cn.Open str
End Sub
Private Sub js_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 教师表 where" & " " & b
If a = "admin" Then
rs.Open "select * from 教师表", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub jxjl_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 教学奖励表 where" & " " & b
If a = "admin" Then
rs.Open "select * from 教学奖励表 ", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub jxjlcy_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 教学奖励成员表 where" & " " & b
If a = "admin" Then
rs.Open "select * from 教学奖励成员表", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub kyjl_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 科研奖励表 where" & " " & b
If a = "admin" Then
rs.Open "select * from 科研奖励表", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub kyjlcy_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 科研奖励成员表 where" & " " & b
If a = "admin" Then
rs.Open "select * from 科研奖励成员表 ", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub lw_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 论文表 where" & " " & b
If a = "admin" Then
rs.Open "select * from 论文表 ", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub shry_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 社会荣誉 where" & " " & b
If a = "admin" Then
rs.Open "select * from 社会荣誉 ", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub xm_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 项目表 where" & " " & b
If a = "admin" Then
rs.Open "select * from 项目表 ", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub xmcy_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 项目成员 where" & " " & b
If a = "admin" Then
rs.Open "select * from 项目成员", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
Private Sub xmly_Click(Index As Integer)
Dim a As String
Dim b As String
Dim c As String
a = Form1.Text1.Text
Set rs = Nothing
rs.CursorLocation = adUseClient
b = "编码" & "=" & a
c = "select * from 项目来源 where" & " " & b
If a = "admin" Then
rs.Open "select * from 项目来源 ", cn, adOpenDynamic, adLockPessimistic
Else
rs.Open c, cn, adOpenDynamic, adLockPessimistic
End If
Set Me.DataGrid1.DataSource = rs
d = Val(Me.Text1.Text) + 1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -