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

📄 xiugai.frm

📁 很简单的小程序
💻 FRM
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "msadodc.ocx"
Begin VB.Form Form2 
   Caption         =   "Form2"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form2"
   ScaleHeight     =   11115
   ScaleWidth      =   15240
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton cmdexit 
      Caption         =   "退出"
      Height          =   615
      Left            =   8280
      TabIndex        =   16
      Top             =   4920
      Width           =   1215
   End
   Begin VB.CommandButton cmddel 
      Caption         =   "删除"
      Height          =   615
      Left            =   6840
      TabIndex        =   15
      Top             =   4920
      Width           =   1215
   End
   Begin MSAdodcLib.Adodc Adodc1 
      Height          =   615
      Left            =   1080
      Top             =   6000
      Width           =   5655
      _ExtentX        =   9975
      _ExtentY        =   1085
      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=   3
      Appearance      =   1
      BackColor       =   -2147483643
      ForeColor       =   -2147483640
      Orientation     =   0
      Enabled         =   -1
      Connect         =   "DSN=test"
      OLEDBString     =   ""
      OLEDBFile       =   ""
      DataSourceName  =   "test"
      OtherAttributes =   ""
      UserName        =   "system"
      Password        =   "manager"
      RecordSource    =   "select * from base;"
      Caption         =   "数据浏览"
      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 VB.CommandButton cmdadd 
      Caption         =   "申请入库"
      Height          =   615
      Left            =   720
      TabIndex        =   14
      Top             =   4920
      Width           =   1215
   End
   Begin VB.CommandButton cmdmodify 
      Caption         =   "修改"
      Height          =   615
      Left            =   5280
      TabIndex        =   13
      Top             =   4920
      Width           =   1335
   End
   Begin VB.CommandButton cmdcancel 
      Caption         =   "取消"
      Height          =   615
      Left            =   3720
      TabIndex        =   12
      Top             =   4920
      Width           =   1335
   End
   Begin VB.CommandButton cmdsave 
      Caption         =   "入库"
      Height          =   615
      Left            =   2160
      TabIndex        =   11
      Top             =   4920
      Width           =   1335
   End
   Begin VB.Frame Frame1 
      Caption         =   "管理"
      Height          =   4215
      Left            =   600
      TabIndex        =   0
      Top             =   480
      Width           =   9015
      Begin VB.TextBox Text1 
         DataField       =   "jsl"
         DataSource      =   "adodc1"
         Height          =   495
         Index           =   4
         Left            =   2280
         TabIndex        =   10
         Top             =   3240
         Width           =   2775
      End
      Begin VB.TextBox Text1 
         DataField       =   "jtype"
         DataSource      =   "adodc1"
         Height          =   495
         Index           =   3
         Left            =   2280
         TabIndex        =   9
         Top             =   2520
         Width           =   2775
      End
      Begin VB.TextBox Text1 
         DataField       =   "jpub"
         DataSource      =   "adodc1"
         Height          =   495
         Index           =   2
         Left            =   2280
         TabIndex        =   8
         Top             =   1680
         Width           =   2775
      End
      Begin VB.TextBox Text1 
         DataField       =   "jname"
         DataSource      =   "adodc1"
         Height          =   495
         Index           =   1
         Left            =   2280
         TabIndex        =   7
         Top             =   1080
         Width           =   2775
      End
      Begin VB.TextBox Text1 
         DataField       =   "jid"
         DataSource      =   "adodc1"
         Height          =   495
         Index           =   0
         Left            =   2280
         TabIndex        =   6
         Top             =   240
         Width           =   2775
      End
      Begin VB.Label Label5 
         Caption         =   "数量"
         Height          =   615
         Left            =   120
         TabIndex        =   5
         Top             =   3360
         Width           =   1095
      End
      Begin VB.Label Label4 
         Caption         =   "类别"
         Height          =   615
         Left            =   120
         TabIndex        =   4
         Top             =   2760
         Width           =   1095
      End
      Begin VB.Label Label3 
         Caption         =   "出版社"
         Height          =   615
         Left            =   120
         TabIndex        =   3
         Top             =   1920
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "名称"
         Height          =   495
         Left            =   120
         TabIndex        =   2
         Top             =   1200
         Width           =   1095
      End
      Begin VB.Label Label1 
         Caption         =   "编号"
         Height          =   495
         Left            =   120
         TabIndex        =   1
         Top             =   360
         Width           =   975
      End
   End
End
Attribute VB_Name = "Form2"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False


Private Sub cdmcancel_Click()
For i = 0 To 4
Text1(i).Text = ""
Next i
cmdadd.Enabled = True
cmdsave.Enabled = True
cmdmodify.Enabled = True
End Sub

Private Sub cmdadd_Click()
Adodc1.Recordset.AddNew
For i = 0 To 4
Text1(i).Enabled = True
Text1(i).Text = ""
Next i
Text1(0).SetFocus
cmdadd.Enabled = False
End Sub

Private Sub cmdcancel_Click()
For i = 0 To 4
Text1(i).Text = ""
Next i
End Sub

Private Sub cmddel_Click()
 Dim myval As String
 myval = MsgBox("是否要删除记录?", vbYesNo)
 If myval = vbYes Then
 Adodc1.Recordset.Delete
 Adodc1.Recordset.MoveNext
 If Adodc1.Recordset.EOF = True Then Adodc1.Recordset.MoveLast
 End If
cmdadd.Enabled = True
cmddel.Enabled = True
cmdsave.Enabled = True
cmdexit.Enabled = True
cmdmodify.Enabled = True
cmdcancel.Enabled = True
End Sub

Private Sub cmdexit_Click()
 Dim frm As New form1
            frm.Show
End Sub

Private Sub cmdmodify_Click()
  If Adodc1.Recordset.RecordCount <> 0 Then
  For i = 0 To 4
  Text1(i).Enabled = True
  Next i
  cmdsave.Enabled = True
  cmdadd.Enabled = True
  cmdmodify.Enabled = False
  Else
    MsgBox ("没有要修改的数据!")
  End If
End Sub

Private Sub cmdsave_Click()
'Adodc1.Recordset.Fields(0) = Trim(Text1(0).Text)
'Adodc1.Recordset.Fields(1) = Trim(Text1(1).Text)
'Adodc1.Recordset.Fields(2) = Trim(Text1(2).Text)
'Adodc1.Recordset.Fields(3) = Trim(Text1(3).Text)
'Adodc1.Recordset.Fields(4) = Trim(Text1(4).Text)
'Adodc1.Recordset.Update
cmdadd.Enabled = True
For i = 0 To 4
Text1(i).Enabled = False
Next i
End Sub



Private Sub Form_Load()
Adodc1.RecordSource = "select * from base order by jid"
Adodc1.Refresh
For i = 0 To 4
Text1(i).Enabled = False
Next i
End Sub

⌨️ 快捷键说明

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