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

📄 copy of dataform1.vb

📁 VBA专业项目进行开发的实例项目的一些源代码
💻 VB
📖 第 1 页 / 共 5 页
字号:
Public Class DataForm1
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub
    Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbUpdateCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents OleDbDeleteCommand1 As System.Data.OleDb.OleDbCommand
    Friend WithEvents objtestdataset As Project1.testdataset
    Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
    Friend WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter
    Friend WithEvents btnLoad As System.Windows.Forms.Button
    Friend WithEvents btnUpdate As System.Windows.Forms.Button
    Friend WithEvents btnCancelAll As System.Windows.Forms.Button
    Friend WithEvents lblAddress_Line1 As System.Windows.Forms.Label
    Friend WithEvents lblAddress_Line2 As System.Windows.Forms.Label
    Friend WithEvents lblCellPhoneNumber As System.Windows.Forms.Label
    Friend WithEvents lblCity As System.Windows.Forms.Label
    Friend WithEvents lblClient_ID As System.Windows.Forms.Label
    Friend WithEvents lblClient_Name As System.Windows.Forms.Label
    Friend WithEvents lblContact_Person As System.Windows.Forms.Label
    Friend WithEvents editAddress_Line1 As System.Windows.Forms.TextBox
    Friend WithEvents editAddress_Line2 As System.Windows.Forms.TextBox
    Friend WithEvents editCellPhoneNumber As System.Windows.Forms.TextBox
    Friend WithEvents editCity As System.Windows.Forms.TextBox
    Friend WithEvents editClient_ID As System.Windows.Forms.TextBox
    Friend WithEvents editClient_Name As System.Windows.Forms.TextBox
    Friend WithEvents editContact_Person As System.Windows.Forms.TextBox
    Friend WithEvents lblEmailAddress As System.Windows.Forms.Label
    Friend WithEvents lblFax As System.Windows.Forms.Label
    Friend WithEvents lblPhoneNumber As System.Windows.Forms.Label
    Friend WithEvents lblRemarks As System.Windows.Forms.Label
    Friend WithEvents lblState As System.Windows.Forms.Label
    Friend WithEvents lblTitle As System.Windows.Forms.Label
    Friend WithEvents lblZipCode As System.Windows.Forms.Label
    Friend WithEvents editEmailAddress As System.Windows.Forms.TextBox
    Friend WithEvents editFax As System.Windows.Forms.TextBox
    Friend WithEvents editPhoneNumber As System.Windows.Forms.TextBox
    Friend WithEvents editRemarks As System.Windows.Forms.TextBox
    Friend WithEvents editState As System.Windows.Forms.TextBox
    Friend WithEvents editTitle As System.Windows.Forms.TextBox
    Friend WithEvents editZipCode As System.Windows.Forms.TextBox
    Friend WithEvents btnNavFirst As System.Windows.Forms.Button
    Friend WithEvents btnNavPrev As System.Windows.Forms.Button
    Friend WithEvents lblNavLocation As System.Windows.Forms.Label
    Friend WithEvents btnNavNext As System.Windows.Forms.Button
    Friend WithEvents btnLast As System.Windows.Forms.Button
    Friend WithEvents btnAdd As System.Windows.Forms.Button
    Friend WithEvents btnDelete As System.Windows.Forms.Button
    Friend WithEvents btnCancel As System.Windows.Forms.Button
    Friend WithEvents Button1 As System.Windows.Forms.Button
    Friend WithEvents Button2 As System.Windows.Forms.Button
    Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
    Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
    Friend WithEvents lblLabelFormDes As System.Windows.Forms.Label

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand()
        Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection()
        Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand()
        Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand()
        Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand()
        Me.objtestdataset = New Project1.testdataset()
        Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter()
        Me.btnLoad = New System.Windows.Forms.Button()
        Me.btnUpdate = New System.Windows.Forms.Button()
        Me.btnCancelAll = New System.Windows.Forms.Button()
        Me.lblAddress_Line1 = New System.Windows.Forms.Label()
        Me.lblAddress_Line2 = New System.Windows.Forms.Label()
        Me.lblCellPhoneNumber = New System.Windows.Forms.Label()
        Me.lblCity = New System.Windows.Forms.Label()
        Me.lblClient_ID = New System.Windows.Forms.Label()
        Me.lblClient_Name = New System.Windows.Forms.Label()
        Me.lblContact_Person = New System.Windows.Forms.Label()
        Me.editAddress_Line1 = New System.Windows.Forms.TextBox()
        Me.editAddress_Line2 = New System.Windows.Forms.TextBox()
        Me.editCellPhoneNumber = New System.Windows.Forms.TextBox()
        Me.editCity = New System.Windows.Forms.TextBox()
        Me.editClient_ID = New System.Windows.Forms.TextBox()
        Me.editClient_Name = New System.Windows.Forms.TextBox()
        Me.editContact_Person = New System.Windows.Forms.TextBox()
        Me.lblEmailAddress = New System.Windows.Forms.Label()
        Me.lblFax = New System.Windows.Forms.Label()
        Me.lblPhoneNumber = New System.Windows.Forms.Label()
        Me.lblRemarks = New System.Windows.Forms.Label()
        Me.lblState = New System.Windows.Forms.Label()
        Me.lblTitle = New System.Windows.Forms.Label()
        Me.lblZipCode = New System.Windows.Forms.Label()
        Me.editEmailAddress = New System.Windows.Forms.TextBox()
        Me.editFax = New System.Windows.Forms.TextBox()
        Me.editPhoneNumber = New System.Windows.Forms.TextBox()
        Me.editRemarks = New System.Windows.Forms.TextBox()
        Me.editState = New System.Windows.Forms.TextBox()
        Me.editTitle = New System.Windows.Forms.TextBox()
        Me.editZipCode = New System.Windows.Forms.TextBox()
        Me.btnNavFirst = New System.Windows.Forms.Button()
        Me.btnNavPrev = New System.Windows.Forms.Button()
        Me.lblNavLocation = New System.Windows.Forms.Label()
        Me.btnNavNext = New System.Windows.Forms.Button()
        Me.btnLast = New System.Windows.Forms.Button()
        Me.btnAdd = New System.Windows.Forms.Button()
        Me.btnDelete = New System.Windows.Forms.Button()
        Me.btnCancel = New System.Windows.Forms.Button()
        Me.Button1 = New System.Windows.Forms.Button()
        Me.Button2 = New System.Windows.Forms.Button()
        Me.TextBox1 = New System.Windows.Forms.TextBox()
        Me.TextBox2 = New System.Windows.Forms.TextBox()
        Me.lblLabelFormDes = New System.Windows.Forms.Label()
        CType(Me.objtestdataset, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'OleDbSelectCommand1
        '
        Me.OleDbSelectCommand1.CommandText = "SELECT Address_Line1, Address_Line2, CellPhoneNumber, City, Client_ID, Client_Nam" & _
        "e, Contact_Person, EmailAddress, Fax, PhoneNumber, Remarks, State, Title, ZipCod" & _
        "e FROM tblClients"
        Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
        '
        'OleDbConnection1
        '
        Me.OleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=C:\EasySel" & _
        "ling\EasySelling.mdb;Mode=Share Deny None;Extended Properties="""";Jet OLEDB:Syste" & _
        "m database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLED" & _
        "B:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk " & _
        "Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="""";Je" & _
        "t OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:" & _
        "Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=Fals" & _
        "e;Jet OLEDB:SFP=False"
        '
        'OleDbInsertCommand1
        '
        Me.OleDbInsertCommand1.CommandText = "INSERT INTO tblClients(Address_Line1, Address_Line2, CellPhoneNumber, City, Clien" & _
        "t_Name, Contact_Person, EmailAddress, Fax, PhoneNumber, Remarks, State, Title, Z" & _
        "ipCode) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"
        Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Address_Line1", System.Data.OleDb.OleDbType.VarWChar, 30, "Address_Line1"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Address_Line2", System.Data.OleDb.OleDbType.VarWChar, 30, "Address_Line2"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("CellPhoneNumber", System.Data.OleDb.OleDbType.VarWChar, 20, "CellPhoneNumber"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("City", System.Data.OleDb.OleDbType.VarWChar, 25, "City"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Client_Name", System.Data.OleDb.OleDbType.VarWChar, 50, "Client_Name"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Contact_Person", System.Data.OleDb.OleDbType.VarWChar, 50, "Contact_Person"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("EmailAddress", System.Data.OleDb.OleDbType.VarWChar, 30, "EmailAddress"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Fax", System.Data.OleDb.OleDbType.VarWChar, 15, "Fax"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("PhoneNumber", System.Data.OleDb.OleDbType.VarWChar, 15, "PhoneNumber"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Remarks", System.Data.OleDb.OleDbType.VarWChar, 100, "Remarks"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("State", System.Data.OleDb.OleDbType.VarWChar, 20, "State"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Title", System.Data.OleDb.OleDbType.VarWChar, 20, "Title"))
        Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("ZipCode", System.Data.OleDb.OleDbType.VarWChar, 6, "ZipCode"))
        '
        'OleDbUpdateCommand1
        '
        Me.OleDbUpdateCommand1.CommandText = "UPDATE tblClients SET Address_Line1 = ?, Address_Line2 = ?, CellPhoneNumber = ?, " & _
        "City = ?, Client_Name = ?, Contact_Person = ?, EmailAddress = ?, Fax = ?, PhoneN" & _
        "umber = ?, Remarks = ?, State = ?, Title = ?, ZipCode = ? WHERE (Client_ID = ?) " & _
        "AND (Address_Line1 = ? OR ? IS NULL AND Address_Line1 IS NULL) AND (Address_Line" & _
        "2 = ? OR ? IS NULL AND Address_Line2 IS NULL) AND (CellPhoneNumber = ? OR ? IS N" & _
        "ULL AND CellPhoneNumber IS NULL) AND (City = ? OR ? IS NULL AND City IS NULL) AN" & _
        "D (Client_Name = ? OR ? IS NULL AND Client_Name IS NULL) AND (Contact_Person = ?" & _
        " OR ? IS NULL AND Contact_Person IS NULL) AND (EmailAddress = ? OR ? IS NULL AND" & _

⌨️ 快捷键说明

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