zl_midForm.frm
资源名称:七八个vb游戏.rar [点击查看]
上传用户:tashmp
上传日期:2010-04-03
资源大小:882k
文件大小:20k
源码类别:
其他游戏
开发平台:
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 zl_midForm
- BackColor = &H00FFC0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "驾驶员资料修改"
- ClientHeight = 4170
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 9720
- Icon = "zl_midForm.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- ScaleHeight = 4170
- ScaleWidth = 9720
- StartUpPosition = 3 'Windows Default
- Begin MSDataGridLib.DataGrid DataGrid1
- Bindings = "zl_midForm.frx":030A
- Height = 735
- Left = 8520
- TabIndex = 20
- Top = 240
- Width = 975
- _ExtentX = 1720
- _ExtentY = 1296
- _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 zl_midAdodc
- Height = 615
- Left = 720
- Top = 2280
- Width = 1695
- _ExtentX = 2990
- _ExtentY = 1085
- 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.PictureBox Picture1
- BackColor = &H00FFFFFF&
- Height = 2535
- Left = 7560
- ScaleHeight = 2475
- ScaleWidth = 1995
- TabIndex = 18
- Top = 1440
- Width = 2055
- End
- Begin VB.CommandButton Command1
- BackColor = &H00FFC0C0&
- Caption = "查找"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 12
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 615
- Left = 7320
- Style = 1 'Graphical
- TabIndex = 16
- Top = 240
- Width = 1455
- End
- Begin VB.Frame Frame2
- BackColor = &H00FFC0C0&
- Height = 2895
- Left = 120
- TabIndex = 3
- Top = 1080
- Width = 7335
- Begin VB.CommandButton Command2
- BackColor = &H00FFC0C0&
- Caption = "删除记录"
- Enabled = 0 'False
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 4920
- Style = 1 'Graphical
- TabIndex = 21
- Top = 2280
- Width = 1935
- End
- Begin VB.CommandButton Command3
- BackColor = &H00FFC0C0&
- Caption = "确定修改"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 9.75
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 4920
- Style = 1 'Graphical
- TabIndex = 19
- Top = 1560
- Width = 1935
- End
- Begin VB.TextBox Text7
- Appearance = 0 'Flat
- 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 = 375
- Left = 4920
- TabIndex = 15
- Top = 1080
- Width = 1935
- End
- Begin VB.TextBox Text6
- Appearance = 0 'Flat
- 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 = 375
- Left = 4920
- TabIndex = 14
- Top = 240
- Width = 1935
- End
- Begin VB.TextBox Text5
- Appearance = 0 'Flat
- 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 = 375
- Left = 1680
- TabIndex = 13
- Top = 2400
- Width = 1935
- End
- Begin VB.TextBox Text4
- Appearance = 0 'Flat
- 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 = 375
- Left = 1680
- TabIndex = 12
- Top = 1680
- Width = 1935
- End
- Begin VB.TextBox Text3
- Appearance = 0 'Flat
- 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 = 375
- Left = 1680
- TabIndex = 11
- Top = 960
- Width = 1935
- End
- Begin VB.TextBox Text2
- Appearance = 0 'Flat
- 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 = 375
- Left = 1680
- TabIndex = 10
- Top = 240
- Width = 1935
- End
- Begin VB.Label Label7
- 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 = 255
- Left = 3720
- TabIndex = 9
- Top = 1080
- Width = 735
- End
- Begin VB.Label Label6
- 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 = 255
- Left = 3720
- TabIndex = 8
- Top = 240
- Width = 1095
- End
- Begin VB.Label Label5
- 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 = 480
- TabIndex = 7
- Top = 2400
- Width = 1455
- 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 = 255
- Left = 480
- TabIndex = 6
- Top = 1680
- Width = 615
- 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 = 255
- Left = 480
- TabIndex = 5
- Top = 960
- Width = 1095
- 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 = 480
- TabIndex = 4
- Top = 240
- Width = 1455
- End
- End
- Begin VB.Frame Frame1
- BackColor = &H00FFC0C0&
- Height = 855
- Left = 120
- TabIndex = 0
- Top = 120
- Width = 7095
- Begin VB.TextBox Text1
- Appearance = 0 'Flat
- 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 = 495
- Left = 2760
- TabIndex = 2
- Top = 240
- Width = 4095
- 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 = 2415
- End
- End
- Begin VB.Line Line1
- X1 = 0
- X2 = 9720
- Y1 = 4080
- Y2 = 4080
- End
- Begin VB.Label Label8
- BackStyle = 0 'Transparent
- Caption = "图片"
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 13.5
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 375
- Left = 8160
- TabIndex = 17
- Top = 960
- Width = 735
- End
- End
- Attribute VB_Name = "zl_midForm"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- '按的驾驶证号查找
- Function zl_midfind() As Boolean
- On Error Resume Next
- 'MsgBox Text1
- zl_midAdodc.Recordset.MoveFirst
- Dim i As Integer
- For i = 0 To zl_midAdodc.Recordset.RecordCount - 1 Step 1
- If zl_midAdodc.Recordset.Fields(0).Value = Text1.Text Then
- zl_midfind = True
- Exit For
- Else
- zl_midAdodc.Recordset.MoveNext
- End If
- Next i
- If i = zl_midAdodc.Recordset.RecordCount Then
- zl_midfind = False
- End If
- End Function
- '查找记录
- Private Sub Command1_Click()
- Dim bol As Boolean
- Dim i As Integer
- Dim da As Date
- bol = zl_midfind()
- Debug.Print bol
- If bol = False Then
- MsgBox "该记录不存在!", 64, "提示"
- Else
- '查找到该记录
- Command2.Enabled = True
- Text2 = zl_midAdodc.Recordset.Fields(0).Value
- Text3 = zl_midAdodc.Recordset.Fields(1).Value
- Text4 = zl_midAdodc.Recordset.Fields(2).Value
- Text5 = zl_midAdodc.Recordset.Fields(3).Value
- If zl_midAdodc.Recordset.Fields(4).Value <> "" Then
- 'MsgBox "date"
- da = zl_midAdodc.Recordset.Fields(4).Value
- Text6 = da
- End If
- If zl_midAdodc.Recordset.Fields(5).Value <> "" Then
- Text7 = zl_midAdodc.Recordset.Fields(5).Value
- End If
- End If
- End Sub
- '删除该条记录
- Private Sub Command2_Click()
- zl_midAdodc.Recordset.Delete
- DoEvents
- zl_midAdodc.Recordset.MoveFirst
- Command2.Enabled = False
- End Sub
- '确定修改该记录
- Private Sub Command3_Click()
- If Text2.Text <> "" Then
- zl_midAdodc.Recordset.Fields("驾驶证号").Value = Text2
- If Text3.Text <> "" Then
- zl_midAdodc.Recordset.Fields("姓名").Value = Text3
- End If
- If Text4.Text <> "" Then
- zl_midAdodc.Recordset.Fields("年龄").Value = Text4
- End If
- If Text5.Text <> "" Then
- zl_midAdodc.Recordset.Fields("驾照类型").Value = Text5
- End If
- If Text6.Text <> "" Then
- Dim da As Date
- da = Text6.Text
- zl_midAdodc.Recordset.Fields("发证时间").Value = da
- End If
- If Text7.Text <> "" Then
- zl_midAdodc.Recordset.Fields("省份").Value = Text7
- End If
- MsgBox "记录以修改!", 64, "修改提示!!"
- Else
- '关键字不能为空
- MsgBox "关键字不能为空 请输关键字入", 16, "友情提示!!"
- End If
- End Sub
- Private Sub Form_Load()
- Dim revalu As Long
- revalu = SetWindowPos(zl_midForm.hwnd, HWND_TOPMOST, Me.CurrentX, Me.CurrentY, _
- 1 / 15 * Me.Width, 1 / 15 * Me.Height, SWP_SHOWWINDOW)
- '连接数据库
- Me.Left = (Screen.Width - Me.Width) / 2 - 150
- Me.Top = (Screen.Height - Me.Height) / 2
- zl_midAdodc.Visible = False
- DataGrid1.Visible = False
- Call zl_lindmid_db
- End Sub
- '连接数据库
- Sub zl_lindmid_db()
- 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"
- zl_midAdodc.ConnectionString = dbpath
- zl_midAdodc.CommandType = adCmdText
- zl_midAdodc.RecordSource = "select * from 驾驶员资料表"
- '动态连接数据库时一定要刷新数据库
- zl_midAdodc.Refresh
- End Sub