bx_Form.frm
资源名称:七八个vb游戏.rar [点击查看]
上传用户:tashmp
上传日期:2010-04-03
资源大小:882k
文件大小:16k
源码类别:
其他游戏
开发平台:
Visual Basic
- VERSION 5.00
- Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
- Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
- Begin VB.Form bx_Form
- BackColor = &H00FFC0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "驾驶员表现管理"
- ClientHeight = 6840
- ClientLeft = 45
- ClientTop = 375
- ClientWidth = 9705
- Icon = "bx_Form.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 6840
- ScaleWidth = 9705
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command4
- BackColor = &H00FFC0C0&
- Caption = "删除"
- Enabled = 0 'False
- Height = 495
- Left = 7440
- MaskColor = &H00FFFFFF&
- Style = 1 'Graphical
- TabIndex = 16
- Top = 6240
- Width = 1575
- End
- Begin VB.CommandButton Command3
- BackColor = &H00FFC0C0&
- Caption = "修改"
- Enabled = 0 'False
- Height = 495
- Left = 3960
- MaskColor = &H00FFFFFF&
- Style = 1 'Graphical
- TabIndex = 15
- Top = 6240
- Width = 1575
- End
- Begin VB.CommandButton Command2
- BackColor = &H00FFC0C0&
- Caption = "添加"
- Height = 495
- Left = 600
- MaskColor = &H00C0C0FF&
- Style = 1 'Graphical
- TabIndex = 14
- Top = 6240
- Width = 1575
- End
- Begin VB.Frame Frame3
- BackColor = &H00FFC0C0&
- Caption = "驾驶员表现"
- Height = 3615
- Left = 240
- TabIndex = 11
- Top = 2520
- Width = 9255
- Begin MSDataGridLib.DataGrid DataGrid1
- Bindings = "bx_Form.frx":030A
- Height = 1695
- Left = 7320
- TabIndex = 13
- Top = 960
- Width = 1455
- _ExtentX = 2566
- _ExtentY = 2990
- _Version = 393216
- HeadLines = 1
- RowHeight = 15
- BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- ColumnCount = 2
- BeginProperty Column00
- DataField = ""
- Caption = ""
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- BeginProperty Column01
- DataField = ""
- Caption = ""
- BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED}
- Type = 0
- Format = ""
- HaveTrueFalseNull= 0
- FirstDayOfWeek = 0
- FirstWeekOfYear = 0
- LCID = 2052
- SubFormatType = 0
- EndProperty
- EndProperty
- SplitCount = 1
- BeginProperty Split0
- BeginProperty Column00
- EndProperty
- BeginProperty Column01
- EndProperty
- EndProperty
- End
- Begin MSAdodcLib.Adodc bx_Adodc
- Height = 495
- Left = 7680
- Top = 360
- Width = 1215
- _ExtentX = 2143
- _ExtentY = 873
- 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= 1
- Appearance = 1
- BackColor = -2147483643
- ForeColor = -2147483640
- Orientation = 0
- Enabled = -1
- Connect = ""
- OLEDBString = ""
- OLEDBFile = ""
- DataSourceName = ""
- OtherAttributes = ""
- UserName = ""
- Password = ""
- RecordSource = ""
- Caption = ""
- BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- _Version = 393216
- End
- Begin VB.TextBox Text5
- BackColor = &H00FFFFFF&
- Height = 3255
- Left = 240
- MultiLine = -1 'True
- TabIndex = 12
- Top = 240
- Width = 8775
- End
- End
- Begin VB.Frame Frame2
- BackColor = &H00FFC0C0&
- Caption = "基本资料"
- Height = 1095
- Left = 240
- TabIndex = 4
- Top = 1200
- Width = 9255
- Begin VB.TextBox Text4
- BackColor = &H00FFC0C0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 7440
- TabIndex = 10
- Top = 360
- Width = 1695
- End
- Begin VB.TextBox Text3
- BackColor = &H00FFC0C0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 4680
- TabIndex = 9
- Top = 360
- Width = 1695
- End
- Begin VB.TextBox Text2
- BackColor = &H00FFC0C0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 1560
- TabIndex = 8
- Top = 360
- Width = 2055
- End
- Begin VB.Label Label4
- BackStyle = 0 'Transparent
- Caption = "年龄:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 6720
- TabIndex = 7
- Top = 360
- Width = 855
- End
- Begin VB.Label Label3
- BackStyle = 0 'Transparent
- Caption = "姓名:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 3720
- TabIndex = 6
- Top = 360
- Width = 855
- End
- Begin VB.Label Label2
- BackStyle = 0 'Transparent
- Caption = "驾照号码:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 240
- TabIndex = 5
- Top = 360
- Width = 1335
- End
- End
- Begin VB.Frame Frame1
- BackColor = &H00FFC0C0&
- Height = 855
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 9375
- Begin VB.CommandButton Command1
- BackColor = &H00FFC0C0&
- Caption = "查询"
- Height = 495
- Left = 7200
- Style = 1 'Graphical
- TabIndex = 3
- Top = 240
- Width = 1935
- End
- Begin VB.TextBox Text1
- BackColor = &H00FFC0C0&
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 13.5
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 615
- Left = 2160
- TabIndex = 2
- Top = 120
- Width = 4935
- End
- Begin VB.Label Label1
- BackStyle = 0 'Transparent
- Caption = "输入驾照号码:"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 360
- TabIndex = 1
- Top = 240
- Width = 1695
- End
- End
- End
- Attribute VB_Name = "bx_Form"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- '查找驾驶员表现记录
- Private Sub Command1_Click()
- Dim i As Integer
- 'bx_Form.Command2.Enabled = False
- 'bx_Form.Command3.Enabled = False
- 'bx_Form.Command4.Enabled = False
- bx_Adodc.Recordset.MoveFirst
- For i = 0 To bx_Adodc.Recordset.RecordCount - 1 Step 1
- If bx_Adodc.Recordset.Fields(0).Value = Text1.Text Then
- Text2.Text = bx_Adodc.Recordset.Fields(0).Value
- Text3.Text = bx_Adodc.Recordset.Fields(1).Value
- Text4.Text = bx_Adodc.Recordset.Fields(2).Value
- Text5.Text = bx_Adodc.Recordset.Fields(3).Value
- Command3.Enabled = True
- Command4.Enabled = True
- Exit For
- Else
- bx_Adodc.Recordset.MoveNext
- End If
- Next i
- If i = bx_Adodc.Recordset.RecordCount Then
- '没有查找到记录
- Text2.Text = ""
- Text3.Text = ""
- Text4.Text = ""
- Text5.Text = ""
- MsgBox "没有查找到记录!!!", 64, "查找提示!"
- End If
- End Sub
- '添加记录
- Private Sub Command2_Click()
- 'MsgBox "ddd"
- If bx_Adodc.Recordset.EOF = True Then
- bx_Adodc.Recordset.MoveLast
- End If
- Dim flag As Boolean
- flag = True
- Command3.Enabled = False
- Command4.Enabled = False
- Debug.Print priview
- If priview = "admini" Then
- If Text2.Text = "" Then
- MsgBox "关键不能为空", 16, "友情提示"
- Else
- Dim i As Integer
- For i = 0 To bx_Adodc.Recordset.RecordCount - 1 Step 1
- If bx_Adodc.Recordset.Fields(0).Value = Text2.Text Then
- flag = False
- Exit For
- End If
- Next i
- If flag = True Then
- bx_Adodc.Recordset.AddNew
- bx_Adodc.Recordset.Fields(0).Value = Text2.Text
- bx_Adodc.Recordset.Fields(1).Value = Text3.Text
- bx_Adodc.Recordset.Fields(2).Value = Text4.Text
- bx_Adodc.Recordset.Fields(3).Value = Text5.Text
- bx_Adodc.Recordset.Update
- MsgBox "该记录以添加!!!", 46, "友情提示!!"
- Else
- MsgBox "该记录以存在!!!", 46, "友情提示!!"
- End If
- End If
- Else
- MsgBox "你没有使用权限!!!", 16, "友情提示"
- End If
- End Sub
- '修改记录
- Private Sub Command3_Click()
- If Text2 = "" Then
- MsgBox "主关键字不能为空!!!", 64, "友情提示!!"
- Else
- bx_Adodc.Recordset.Fields(0).Value = Text2
- bx_Adodc.Recordset.Fields(1).Value = Text3
- bx_Adodc.Recordset.Fields(2).Value = Text4
- bx_Adodc.Recordset.Fields(3).Value = Text5
- MsgBox "该记录以修改"
- End If
- End Sub
- '删除记录
- Private Sub Command4_Click()
- bx_Adodc.Recordset.Delete
- bx_Adodc.Recordset.MoveFirst
- Text2 = ""
- Text3 = ""
- Text4 = ""
- Text5.Text = ""
- MsgBox "该记录以删除!!", 64, "友情提示!!"
- End Sub
- '驾驶员表现管理
- Private Sub Form_Load()
- Dim revalu As Long
- bx_Adodc.Visible = False
- DataGrid1.Visible = False
- 'Me.Show '显示窗题
- '连接驾驶员资料表
- revalu = SetWindowPos(bx_Form.hwnd, HWND_TOPMOST, Me.CurrentX, Me.CurrentY, _
- 1 / 15 * Me.Width, 1 / 15 * Me.Height, SWP_SHOWWINDOW)
- Me.Left = (Screen.Width - Me.Width) / 2 - 100
- Me.Top = (Screen.Height - Me.Height) / 2 - 150
- ''连接数据库
- Call bx_linedb
- End Sub
- '连接数据库
- Sub bx_linedb()
- Dim dbpath As String
- If Right(App.Path, 1) <> "" Then
- dbpath = App.Path & ""
- Else
- dbpath = App.Path
- End If
- '以管理员登陆
- 'MsgBox "gly"
- dbpath = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False; Data Source=" & dbpath & "年审评定数据库.mdb"
- bx_Adodc.ConnectionString = dbpath
- bx_Adodc.CommandType = adCmdText
- bx_Adodc.RecordSource = "select * from 驾驶员表现表"
- '动态连接数据库时一定要刷新数据库
- bx_Adodc.Refresh
- End Sub