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

📄 frm_editreader.vb

📁 是关于图书管理系统的用vb.net 和access开发的
💻 VB
字号:
Imports System.Data.OleDb
Public Class frm_EditReader


    Dim myConnection As New OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0; Data source=D:\library.mdb")
    Dim myCommand As OleDbCommand
    Dim myReader As OleDbDataReader

    Private Sub frm_EditUser_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'LibraryDataSet.SystemUsers' table. You can move, or remove it, as needed.
        Me.SystemUsersTableAdapter.Fill(Me.LibraryDataSet.SystemUsers)

    End Sub

    Private Sub exitbt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitbt.Click
        Me.Close()
    End Sub

    Private Sub savebt_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles savebt.Click
        If UserNameTextBox.Text = "" Then
            displayMsg("Must enter name!")
            Exit Sub
        End If

        If PasswordTextBox.Text = "" Then
            displayMsg("Must enter password!")
            Exit Sub
        End If

        myConnection.Open()

        myCommand = New OleDbCommand("UPDATE Backup SET username='" & UserNameTextBox.Text & "',[password]= '" & _
        PasswordTextBox.Text & "' ,Status = '" & StatusTextBox.Text & "' ,Address = '" & AddressTextBox.Text & _
        "' ,Phone = '" & PhoneTextBox.Text & "' ,CellPhone = '" & CellPhoneTextBox.Text & "' ,Email = '" & EmailTextBox.Text & _
        "' ,AdminRights = '" & ComboBox1.Text & "' ,LibRights = '" & ComboBox2.Text & "' ,ReaderRights = '" & ComboBox3.Text & "' ", myConnection)

        Try
            MyCommand.ExecuteNonQuery()
        Catch c As Exception
            MsgBox(c.ToString)
        End Try
        MyConnection.Close()
        MyCommand.Dispose()
    End Sub
    Sub displayMsg(ByVal msg As String)
        MsgBox(msg, MsgBoxStyle.Information, "libarary management system")

    End Sub
End Class

⌨️ 快捷键说明

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