⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 add.frm

📁 一个简单的大学宿舍管理系统环境:vb6.0+acce
💻 FRM
📖 第 1 页 / 共 2 页
字号:
         Width           =   1455
      End
      Begin VB.TextBox Text5 
         BorderStyle     =   0  'None
         Height          =   255
         Left            =   1200
         TabIndex        =   16
         Top             =   2040
         Width           =   1215
      End
      Begin VB.TextBox Text4 
         BorderStyle     =   0  'None
         Height          =   270
         Left            =   1200
         TabIndex        =   15
         Top             =   825
         Width           =   1215
      End
      Begin VB.TextBox Text3 
         Appearance      =   0  'Flat
         BorderStyle     =   0  'None
         Height          =   255
         Left            =   3840
         TabIndex        =   14
         Top             =   240
         Width           =   1095
      End
      Begin VB.TextBox Text2 
         BorderStyle     =   0  'None
         Height          =   255
         Left            =   3840
         TabIndex        =   13
         Top             =   1440
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         BorderStyle     =   0  'None
         Height          =   255
         Left            =   3840
         TabIndex        =   12
         Top             =   2640
         Width           =   1455
      End
      Begin VB.Label Label11 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "备注"
         Height          =   180
         Left            =   600
         TabIndex        =   11
         Top             =   3120
         Width           =   360
      End
      Begin VB.Label Label10 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "寝室电话"
         Height          =   180
         Left            =   240
         TabIndex        =   10
         Top             =   2640
         Width           =   720
      End
      Begin VB.Label Label9 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "个人电话"
         Height          =   180
         Left            =   2880
         TabIndex        =   9
         Top             =   2640
         Width           =   720
      End
      Begin VB.Label Label8 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "学制"
         Height          =   180
         Left            =   3240
         TabIndex        =   8
         Top             =   2040
         Width           =   360
      End
      Begin VB.Label Label7 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "入学时间"
         Height          =   180
         Left            =   240
         TabIndex        =   7
         Top             =   2040
         Width           =   720
      End
      Begin VB.Label Label6 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "学号"
         Height          =   180
         Left            =   3240
         TabIndex        =   6
         Top             =   1440
         Width           =   360
      End
      Begin VB.Label Label5 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "班级"
         Height          =   180
         Left            =   600
         TabIndex        =   5
         Top             =   1440
         Width           =   360
      End
      Begin VB.Label Label4 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "性别"
         Height          =   180
         Left            =   3240
         TabIndex        =   4
         Top             =   840
         Width           =   360
      End
      Begin VB.Label Label3 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "姓名"
         Height          =   180
         Left            =   600
         TabIndex        =   3
         Top             =   840
         Width           =   360
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "寝室"
         Height          =   180
         Left            =   3240
         TabIndex        =   2
         Top             =   240
         Width           =   360
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "宿舍号"
         Height          =   180
         Left            =   240
         TabIndex        =   1
         Top             =   240
         Width           =   540
      End
   End
End
Attribute VB_Name = "add"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub Command1_Click()
On Error Resume Next

If Combo1.Text = "" Or Combo2.Text = "" Or Combo3.Text = "" Or Text1.Text = "" Or Text3.Text = "" Or Text3.Text = "" Then
 MsgBox "请输入详细资料!", , "系统提示"
 Exit Sub
End If

Adodc1.Refresh
Adodc1.Recordset.Find "公寓名称='" & Combo1.Text & "'"
If Adodc1.Recordset.EOF = True Then
MsgBox "查无此公寓", , "提示"
Adodc1.Recordset.MoveFirst
Exit Sub
End If
Adodc4.Refresh
Adodc4.Recordset.Find "寝室='" & Text3.Text & "' and 公寓='" & Combo1.Text & "'"
If Adodc4.Recordset.EOF = True Then
 MsgBox "查无此寝室", , "提示"
 Adodc4.Recordset.MoveFirst
 Exit Sub
End If
Adodc2.Refresh
Adodc2.Recordset.Find "class='" & Combo2.Text & "'"
If Adodc2.Recordset.EOF = True Then
MsgBox "查无此班级", , "提示"
Adodc2.Recordset.MoveFirst
Exit Sub
End If

With Adodc3
.Recordset.AddNew
.Recordset.Fields(0).Value = Combo1.Text
.Recordset.Fields(1).Value = Text3.Text
.Recordset.Fields(2).Value = Text4.Text
.Recordset.Fields(3).Value = Text2.Text
.Recordset.Fields(4).Value = Combo2.Text
.Recordset.Fields(5).Value = Combo3.Text
.Recordset.Fields(6).Value = Text5.Text
.Recordset.Fields(7).Value = Combo4.Text
.Recordset.Fields(8).Value = Text6.Text
.Recordset.Fields(9).Value = Text1.Text
.Recordset.Fields(10).Value = Text7.Text
.Recordset.Update
End With
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""

Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""

Set main.DataGrid1.datasource = Adodc3
main.DataGrid1.Refresh

End Sub

Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""

Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
End Sub

Private Sub Command3_Click()
Unload Me
End Sub

Private Sub Command4_Click()

End Sub



Private Sub Form_Activate()
On Error Resume Next
Combo1.Clear
Dim I As Integer
I = 1
Adodc1.Refresh
If Adodc1.Recordset.RecordCount <> 0 Then
Do While I < Adodc1.Recordset.RecordCount
    Combo1.AddItem (Adodc1.Recordset.Fields("公寓名称"))
    Adodc1.Recordset.MoveNext
    I = I + 1
Loop
End If
Dim J As Integer
Combo2.Clear
J = 1
Adodc2.Refresh
 If Adodc2.Recordset.RecordCount <> 0 Then
Do While J < Adodc2.Recordset.RecordCount
    Combo2.AddItem (Adodc2.Recordset.Fields("class"))
    Adodc2.Recordset.MoveNext
    J = J + 1
Loop
End If
End Sub

Private Sub Form_Load()
On Error Resume Next
Dim provider As String
Dim datasource As String
provider = "provider=Microsoft.jet.oledb.4.0"
datasource = "data source=" & App.Path & "\DB.mdb"

With Adodc1
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdTable
.RecordSource = "gongyu"
.Refresh
End With

With Adodc2
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdTable
.RecordSource = "class"
.Refresh
End With

With Adodc3
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdTable
.RecordSource = "users"
.Refresh
End With

With Adodc4
.Mode = adModeReadWrite
.ConnectionString = provider & ";" & datasource
.CommandType = adCmdTable
.RecordSource = "qinshi"
.Refresh
End With

Combo3.AddItem "男"
Combo3.AddItem "女"
Combo4.AddItem "三年"
Combo4.AddItem "五年"
End Sub


Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)

End Sub

Private Sub Label1_Click()

End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -