?? form4.vb
字號:
'引用名稱空間
Imports System.Data
Imports System.Data.OleDb
Public Class Form4
Inherits System.Windows.Forms.Form
'n是添加或者修改的狀態參數
Dim n As Integer = 0
'ncommand是SQL命令
Dim ncommand As New OleDbCommand()
'nsql是SQL語句,bak1,bak2,bak3是用來備份的字符串
Dim nsql, bak1, bak2, bak3 As String
#Region " Windows 窗體設計器生成的代碼 "
Public Sub New()
MyBase.New()
'該調用是 Windows 窗體設計器所必需的。
InitializeComponent()
'在 InitializeComponent() 調用之后添加任何初始化
End Sub
'窗體重寫處置以清理組件列表。
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
'Windows 窗體設計器所必需的
Private components As System.ComponentModel.IContainer
'注意:以下過程是 Windows 窗體設計器所必需的
'可以使用 Windows 窗體設計器修改此過程。
'不要使用代碼編輯器修改它。
Friend WithEvents DataGrid1 As System.Windows.Forms.DataGrid
Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents Incometable1 As WindowsApplication13.incometable
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents TextBox2 As System.Windows.Forms.TextBox
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents Button6 As System.Windows.Forms.Button
Friend WithEvents incometable As System.Data.OleDb.OleDbDataAdapter
Friend WithEvents MonthCalendar1 As System.Windows.Forms.MonthCalendar
Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
Friend WithEvents ComboBox1 As System.Windows.Forms.ComboBox
Friend WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter
Friend WithEvents OleDbSelectCommand2 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbInsertCommand2 As System.Data.OleDb.OleDbCommand
Friend WithEvents Income1 As WindowsApplication13.income
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.DataGrid1 = New System.Windows.Forms.DataGrid
Me.Incometable1 = New WindowsApplication13.incometable
Me.incometable = New System.Data.OleDb.OleDbDataAdapter
Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.TextBox2 = New System.Windows.Forms.TextBox
Me.Button5 = New System.Windows.Forms.Button
Me.Button4 = New System.Windows.Forms.Button
Me.Button3 = New System.Windows.Forms.Button
Me.Button2 = New System.Windows.Forms.Button
Me.Button1 = New System.Windows.Forms.Button
Me.Button6 = New System.Windows.Forms.Button
Me.MonthCalendar1 = New System.Windows.Forms.MonthCalendar
Me.ComboBox1 = New System.Windows.Forms.ComboBox
Me.Income1 = New WindowsApplication13.income
Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter
Me.OleDbInsertCommand2 = New System.Data.OleDb.OleDbCommand
Me.OleDbSelectCommand2 = New System.Data.OleDb.OleDbCommand
CType(Me.DataGrid1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Incometable1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Income1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'DataGrid1
'
Me.DataGrid1.CaptionText = "收入記錄"
Me.DataGrid1.DataMember = ""
Me.DataGrid1.DataSource = Me.Incometable1.IncomeTable
Me.DataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.DataGrid1.Location = New System.Drawing.Point(298, 17)
Me.DataGrid1.Name = "DataGrid1"
Me.DataGrid1.ReadOnly = True
Me.DataGrid1.Size = New System.Drawing.Size(316, 319)
Me.DataGrid1.TabIndex = 0
'
'Incometable1
'
Me.Incometable1.DataSetName = "incometable"
Me.Incometable1.Locale = New System.Globalization.CultureInfo("zh-CN")
'
'incometable
'
Me.incometable.InsertCommand = Me.OleDbInsertCommand1
Me.incometable.SelectCommand = Me.OleDbSelectCommand1
Me.incometable.TableMappings.AddRange(New System.Data.Common.DataTableMapping() {New System.Data.Common.DataTableMapping("Table", "IncomeTable", New System.Data.Common.DataColumnMapping() {New System.Data.Common.DataColumnMapping("日期", "日期"), New System.Data.Common.DataColumnMapping("項目名稱", "項目名稱"), New System.Data.Common.DataColumnMapping("金額", "金額")})})
'
'OleDbInsertCommand1
'
Me.OleDbInsertCommand1.CommandText = "INSERT INTO IncomeTable(金額, 日期, 項目名稱) VALUES (?, ?, ?)"
Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("金額", System.Data.OleDb.OleDbType.VarChar, 20, "金額"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("日期", System.Data.OleDb.OleDbType.VarChar, 20, "日期"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("項目名稱", System.Data.OleDb.OleDbType.VarChar, 15, "項目名稱"))
'
'OleDbConnection1
'
Me.OleDbConnection1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=finance.md" & _
"b;Mode=Share Deny None;Extended Properties="""";Jet OLEDB:System database="""";Jet O" & _
"LEDB:Registry Path="""";Jet OLEDB:Database Password="""";Jet OLEDB:Engine Type=5;Jet" & _
" OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Glo" & _
"bal Bulk Transactions=1;Jet OLEDB:New Database Password="""";Jet OLEDB:Create Syst" & _
"em Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale o" & _
"n Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=Fal" & _
"se"
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT 金額, 日期, 項目名稱 FROM IncomeTable"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(125, 69)
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(86, 21)
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = ""
'
'Label1
'
Me.Label1.Location = New System.Drawing.Point(58, 69)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(38, 17)
Me.Label1.TabIndex = 2
Me.Label1.Text = "金額"
'
'Label2
'
Me.Label2.Location = New System.Drawing.Point(58, 112)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(38, 17)
Me.Label2.TabIndex = 3
Me.Label2.Text = "日期"
'
'Label3
'
Me.Label3.Location = New System.Drawing.Point(29, 146)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(77, 18)
Me.Label3.TabIndex = 4
Me.Label3.Text = "項目名稱"
'
'TextBox2
'
Me.TextBox2.Location = New System.Drawing.Point(125, 112)
Me.TextBox2.Name = "TextBox2"
Me.TextBox2.ReadOnly = True
Me.TextBox2.Size = New System.Drawing.Size(86, 21)
Me.TextBox2.TabIndex = 5
Me.TextBox2.Text = ""
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(115, 319)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(87, 26)
Me.Button5.TabIndex = 14
Me.Button5.Text = "關閉"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(182, 267)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(68, 35)
Me.Button4.TabIndex = 13
Me.Button4.Text = "取消"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(67, 267)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(67, 35)
Me.Button3.TabIndex = 12
Me.Button3.Text = "修改"
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(182, 207)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(68, 34)
Me.Button2.TabIndex = 11
Me.Button2.Text = "刪除"
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(67, 207)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(67, 34)
Me.Button1.TabIndex = 10
Me.Button1.Text = "增加"
'
'Button6
'
Me.Button6.Location = New System.Drawing.Point(221, 112)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(48, 26)
Me.Button6.TabIndex = 15
Me.Button6.Text = "選擇"
'
'MonthCalendar1
'
Me.MonthCalendar1.Location = New System.Drawing.Point(278, 198)
Me.MonthCalendar1.Name = "MonthCalendar1"
Me.MonthCalendar1.TabIndex = 16
Me.MonthCalendar1.Visible = False
'
'ComboBox1
'
Me.ComboBox1.DataSource = Me.Income1.Income
Me.ComboBox1.DisplayMember = "項目名稱"
Me.ComboBox1.Location = New System.Drawing.Point(125, 146)
Me.ComboBox1.Name = "ComboBox1"
Me.ComboBox1.Size = New System.Drawing.Size(144, 20)
Me.ComboBox1.TabIndex = 17
'
'Income1
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -