jf_xgForm.frm
资源名称:七八个vb游戏.rar [点击查看]
上传用户:tashmp
上传日期:2010-04-03
资源大小:882k
文件大小:14k
源码类别:
其他游戏
开发平台:
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 jf_xgForm
- BackColor = &H00FFC0C0&
- Caption = "驾驶员积分管理"
- ClientHeight = 4095
- ClientLeft = 60
- ClientTop = 390
- ClientWidth = 10050
- Icon = "jf_xgForm.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 4095
- ScaleWidth = 10050
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton Command4
- BackColor = &H00FFC0C0&
- Caption = "删除记录"
- Height = 495
- Left = 7320
- Style = 1 'Graphical
- TabIndex = 13
- Top = 2760
- Width = 1815
- End
- Begin VB.CommandButton Command3
- BackColor = &H00FFC0C0&
- Caption = "修改记录"
- Height = 495
- Left = 4080
- Style = 1 'Graphical
- TabIndex = 12
- Top = 2760
- Width = 1815
- End
- Begin VB.CommandButton Command2
- BackColor = &H00FFC0C0&
- Caption = "添加记录"
- Height = 495
- Left = 720
- Style = 1 'Graphical
- TabIndex = 11
- Top = 2760
- Width = 1815
- End
- Begin MSDataGridLib.DataGrid DataGrid1
- Bindings = "jf_xgForm.frx":030A
- Height = 735
- Left = 5880
- TabIndex = 10
- Top = 1920
- Width = 1575
- _ExtentX = 2778
- _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 fj_xgAdodc
- Height = 495
- Left = 2760
- Top = 2640
- 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.Frame Frame1
- BackColor = &H00FFC0C0&
- Caption = "基本资料"
- Height = 1455
- Left = 120
- TabIndex = 3
- Top = 960
- Width = 9855
- 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 = 8160
- TabIndex = 9
- Top = 360
- Width = 1335
- 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 = 375
- Left = 4800
- TabIndex = 7
- 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 = 375
- Left = 1320
- TabIndex = 5
- Top = 360
- Width = 2415
- 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 = 8
- Top = 480
- Width = 1335
- 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 = 3960
- 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 = 120
- TabIndex = 4
- Top = 360
- Width = 1335
- End
- End
- Begin VB.CommandButton Command1
- BackColor = &H00FFC0C0&
- Caption = "查询"
- Height = 615
- Left = 8280
- Style = 1 'Graphical
- TabIndex = 2
- Top = 120
- Width = 1575
- 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 = 495
- Left = 1920
- TabIndex = 1
- Top = 120
- Width = 6255
- End
- Begin VB.Line Line2
- BorderWidth = 2
- X1 = 0
- X2 = 10080
- Y1 = 4080
- Y2 = 4080
- End
- Begin VB.Line Line1
- X1 = 0
- X2 = 9960
- Y1 = 840
- Y2 = 840
- End
- Begin VB.Label Label1
- 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 = 240
- TabIndex = 0
- Top = 120
- Width = 1455
- End
- End
- Attribute VB_Name = "jf_xgForm"
- 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
- fj_xgAdodc.Refresh
- If Text1 = "" Then
- MsgBox "请输入要查询驾驶证号!", 48, "友情提示!!!"
- Else
- fj_xgAdodc.Recordset.MoveFirst
- For i = 0 To fj_xgAdodc.Recordset.RecordCount - 1 Step 1
- Debug.Print fj_xgAdodc.Recordset.Fields(0).Value
- If fj_xgAdodc.Recordset.Fields(0).Value = Text1.Text Then
- Text2 = fj_xgAdodc.Recordset.Fields(0).Value
- Text3 = fj_xgAdodc.Recordset.Fields(1).Value
- Text4 = fj_xgAdodc.Recordset.Fields(2).Value
- ' Command2.Enabled = True
- Command3.Enabled = True
- Command4.Enabled = True
- Exit For
- Else
- fj_xgAdodc.Recordset.MoveNext
- End If
- Next i
- If i = fj_xgAdodc.Recordset.RecordCount Then
- MsgBox "该记录不存在!!", 48, "友情提示!!!"
- End If
- End If
- End Sub
- Private Sub Command2_Click()
- Dim i As Integer
- Dim da As Date
- fj_xgAdodc.Recordset.MoveFirst
- For i = 0 To fj_xgAdodc.Recordset.RecordCount - 1 Step 1
- If fj_xgAdodc.Recordset.Fields(0).Value = Text2.Text Then
- MsgBox "该记录以存在!!", 64, "友情提示"
- Exit Sub
- Else
- fj_xgAdodc.Recordset.MoveNext
- End If
- If i = fj_xgAdodc.Recordset.RecordCount - 1 Then
- '该记录不存在 开始添加
- fj_xgAdodc.Recordset.AddNew
- fj_xgAdodc.Recordset.Fields(0).Value = Text2
- fj_xgAdodc.Recordset.Fields(1).Value = Text3
- fj_xgAdodc.Recordset.Fields(2).Value = Text4
- fj_xgAdodc.Recordset.Update
- MsgBox "该记录以添加!", 64, "友情提示"
- fj_xgAdodc.Refresh
- End If
- Next i
- End Sub
- '修改记录
- Private Sub Command3_Click()
- If Text2.Text = "" Then
- MsgBox "关键字不能为空!", 48, "友情提示"
- Else
- fj_xgAdodc.Recordset.Fields(0).Value = Text2
- fj_xgAdodc.Recordset.Fields(1).Value = Text3
- fj_xgAdodc.Recordset.Fields(2).Value = Text4
- MsgBox "以确定修改!", 64, "友情提示"
- End If
- End Sub
- '删除记录
- Private Sub Command4_Click()
- fj_xgAdodc.Recordset.Delete
- DoEvents
- Text2 = ""
- Text3 = ""
- Text4 = ""
- MsgBox "该记录以删除!", 48, "友情提示"
- End Sub
- Private Sub Form_Load()
- Dim revalu As Long
- 'Command2.Enabled = False
- Command3.Enabled = False
- Command4.Enabled = False
- fj_xgAdodc.Visible = False
- DataGrid1.Visible = False
- 'Me.Show '显示窗题
- '连接驾驶员资料表
- revalu = SetWindowPos(jf_xgForm.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 - 150
- Call lind_jfxg_db
- End Sub
- '连接数据库
- Sub lind_jfxg_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"
- fj_xgAdodc.ConnectionString = dbpath
- fj_xgAdodc.CommandType = adCmdText
- fj_xgAdodc.RecordSource = "select * from 驾驶员积分管理表"
- '动态连接数据库时一定要刷新数据库
- fj_xgAdodc.Refresh
- End Sub