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

📄 addressbook.frm

📁 用vb模拟dbms程序
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Address Book 1.0"
   ClientHeight    =   4500
   ClientLeft      =   45
   ClientTop       =   615
   ClientWidth     =   6300
   ControlBox      =   0   'False
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4500
   ScaleWidth      =   6300
   StartUpPosition =   2  'CenterScreen
   Begin VB.Frame Frame1 
      Height          =   4455
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   6255
      Begin VB.Frame Frame2 
         Height          =   1095
         Left            =   4200
         TabIndex        =   17
         Top             =   2520
         Width           =   1815
         Begin VB.CommandButton Command3 
            Caption         =   "Search"
            Height          =   375
            Left            =   240
            TabIndex        =   18
            Top             =   600
            Width           =   1335
         End
         Begin VB.Label Label8 
            Alignment       =   2  'Center
            Caption         =   "Search By Number:"
            Height          =   255
            Left            =   120
            TabIndex        =   19
            Top             =   240
            Width           =   1575
         End
      End
      Begin VB.CommandButton Command2 
         Caption         =   "Delete Contact"
         Height          =   375
         Left            =   4440
         TabIndex        =   16
         Top             =   1920
         Width           =   1335
      End
      Begin VB.CommandButton Command1 
         Caption         =   "Add Contact"
         Height          =   375
         Left            =   4440
         TabIndex        =   15
         Top             =   1440
         Width           =   1335
      End
      Begin VB.TextBox Text7 
         DataField       =   "emailaddy"
         DataSource      =   "Data1"
         Height          =   285
         Left            =   1680
         TabIndex        =   14
         Top             =   3360
         Width           =   2055
      End
      Begin VB.TextBox Text6 
         DataField       =   "MobileNumber"
         DataSource      =   "Data1"
         Height          =   285
         Left            =   1680
         TabIndex        =   13
         Top             =   3000
         Width           =   2055
      End
      Begin VB.TextBox Text5 
         DataField       =   "HomeNumber"
         DataSource      =   "Data1"
         Height          =   285
         Left            =   1680
         TabIndex        =   12
         Top             =   2640
         Width           =   2055
      End
      Begin VB.TextBox Text4 
         DataField       =   "city"
         DataSource      =   "Data1"
         Height          =   285
         Left            =   1680
         TabIndex        =   11
         Top             =   2280
         Width           =   2055
      End
      Begin VB.TextBox Text3 
         DataField       =   "age"
         DataSource      =   "Data1"
         Height          =   285
         Left            =   1680
         TabIndex        =   10
         Top             =   1920
         Width           =   2055
      End
      Begin VB.TextBox Text2 
         DataField       =   "LastName"
         DataSource      =   "Data1"
         Height          =   285
         Left            =   1680
         TabIndex        =   4
         Top             =   1560
         Width           =   2055
      End
      Begin VB.TextBox Text1 
         DataField       =   "FirstName"
         DataSource      =   "Data1"
         Height          =   285
         Left            =   1680
         TabIndex        =   1
         Top             =   1200
         Width           =   2055
      End
      Begin VB.Data Data1 
         Caption         =   "                   Contacts"
         Connect         =   "Access"
         DatabaseName    =   "C:\WINDOWS\Desktop\codebank\address book\addy.mdb"
         DefaultCursorType=   0  'DefaultCursor
         DefaultType     =   2  'UseODBC
         Exclusive       =   0   'False
         Height          =   345
         Left            =   240
         Options         =   0
         ReadOnly        =   0   'False
         RecordsetType   =   1  'Dynaset
         RecordSource    =   "addy"
         Top             =   3840
         Width           =   3615
      End
      Begin VB.Frame Frame3 
         Height          =   1215
         Left            =   4200
         TabIndex        =   20
         Top             =   1200
         Width           =   1815
      End
      Begin VB.Label Label9 
         Alignment       =   2  'Center
         Caption         =   "Address Book "
         BeginProperty Font 
            Name            =   "Verdana"
            Size            =   24
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   615
         Left            =   240
         TabIndex        =   21
         Top             =   240
         Width           =   5775
      End
      Begin VB.Label Label7 
         Caption         =   "Email Address:"
         Height          =   375
         Left            =   240
         TabIndex        =   9
         Top             =   3360
         Width           =   1215
      End
      Begin VB.Label Label6 
         Caption         =   "Mobile Number:"
         Height          =   375
         Left            =   240
         TabIndex        =   8
         Top             =   3000
         Width           =   1215
      End
      Begin VB.Label Label5 
         Caption         =   "Home Number:"
         Height          =   375
         Left            =   240
         TabIndex        =   7
         Top             =   2640
         Width           =   1095
      End
      Begin VB.Label Label4 
         Caption         =   "Age:"
         Height          =   375
         Left            =   240
         TabIndex        =   6
         Top             =   1920
         Width           =   735
      End
      Begin VB.Label Label3 
         Caption         =   "City:"
         Height          =   255
         Left            =   240
         TabIndex        =   5
         Top             =   2280
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "Last Name:"
         Height          =   255
         Left            =   240
         TabIndex        =   3
         Top             =   1560
         Width           =   1215
      End
      Begin VB.Label Label1 
         Caption         =   "First Name:"
         Height          =   255
         Left            =   240
         TabIndex        =   2
         Top             =   1200
         Width           =   855
      End
   End
   Begin VB.Menu mnufile 
      Caption         =   "File"
      Begin VB.Menu mnuexitprogram 
         Caption         =   "Exit Program"
      End
   End
   Begin VB.Menu mnupassword 
      Caption         =   "Password"
      Begin VB.Menu mnuchangepassword 
         Caption         =   "Change Password"
      End
      Begin VB.Menu mnuviewpassword 
         Caption         =   "View Password"
      End
   End
   Begin VB.Menu mnuhelp 
      Caption         =   "Help"
      Begin VB.Menu mnuabout 
         Caption         =   "About"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Data1.Recordset.AddNew

End Sub

Private Sub Command2_Click()
With Data1.Recordset
On Error GoTo ErrorHandler
.Delete ' Deletes the record
MsgBox "Contact Was Deleted Successfully!", vbInformation

  
  .MoveNext
  
  
Exit Sub

ErrorHandler:
If Err.Number = 3021 Then
MsgBox "You Cannot Delete A Contact Because You Currently Have No Entries Added To Your Address Book!", vbInformation


Else
MsgBox "Error: " + Err.Description
Label11.Visible = True
End If
End With
End Sub

Private Sub Command3_Click()
Dim searchvar As String
Dim sBookMark As String
searchvar = InputBox("Enter A Phone Number To Find Contact")
searchvar = Trim$(searchvar) ' removes surplus spaces
If searchvar <> "" Then 'canel if nothing entered
With Data1.Recordset
.FindFirst "MobileNumber like'" + searchvar + "*'"
If .NoMatch Then 'record not found
MsgBox "No Such Contact!", vbInformation



End If
End With
End If
End Sub

Private Sub Command4_Click()
End
End Sub

Private Sub Form_Load()
Me.Hide
FrmLogin.Show
End Sub

Private Sub mnuabout_Click()
MsgBox "Created by Vivian Richards VB Labs!", vbInformation

End Sub

Private Sub mnuchangepassword_Click()
FrmChangePassword.Show
End Sub

Private Sub mnuexitprogram_Click()
End
End Sub

Private Sub mnuviewpassword_Click()

Dim strTest As String
    strTest = GetValue("Main", "Password", App.Path & "\" & con_INI_File)
   
    MsgBox Decrypt(strTest), 8, " Current Password!"
    
End Sub

⌨️ 快捷键说明

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