zl_tjForm.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 zl_tjForm
- BackColor = &H00FFC0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "驾驶员资料添加"
- ClientHeight = 4290
- ClientLeft = 45
- ClientTop = 330
- ClientWidth = 8490
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4290
- ScaleWidth = 8490
- StartUpPosition = 3 'Windows Default
- Begin MSDataGridLib.DataGrid DataGrid1
- Bindings = "zl_tjForm.frx":0000
- Height = 855
- Left = 5160
- TabIndex = 14
- Top = 3000
- Width = 2775
- _ExtentX = 4895
- _ExtentY = 1508
- _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_tjAdodc
- Height = 375
- Left = 2280
- Top = 3000
- Width = 1935
- _ExtentX = 3413
- _ExtentY = 661
- 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 = "Adodc1"
- 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 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 = 495
- Left = 6240
- TabIndex = 13
- Top = 840
- Width = 2175
- 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 = 495
- Left = 6240
- TabIndex = 12
- Top = 120
- Width = 2175
- 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 = 495
- Left = 2160
- TabIndex = 11
- Top = 2280
- Width = 2175
- 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 = 495
- Left = 2160
- TabIndex = 10
- Top = 1560
- Width = 2175
- 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 = 495
- Left = 2160
- TabIndex = 9
- Top = 840
- Width = 2175
- End
- Begin VB.TextBox Text1
- 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 = 495
- Left = 2160
- TabIndex = 8
- Top = 120
- Width = 2175
- End
- Begin VB.CommandButton Command2
- BackColor = &H00FFC0C0&
- Caption = "取消"
- Height = 495
- Left = 6240
- Style = 1 'Graphical
- TabIndex = 7
- Top = 2400
- Width = 1335
- End
- Begin VB.CommandButton Command1
- BackColor = &H00FFC0C0&
- Caption = "添加"
- Height = 495
- Left = 6240
- Style = 1 'Graphical
- TabIndex = 6
- Top = 1560
- Width = 1335
- End
- Begin VB.Label Label6
- 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 = 4560
- TabIndex = 5
- Top = 840
- Width = 1095
- End
- Begin VB.Label Label5
- 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 = 4560
- TabIndex = 4
- Top = 120
- Width = 1455
- End
- Begin VB.Label Label4
- 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 = 360
- TabIndex = 3
- Top = 2280
- Width = 1455
- End
- Begin VB.Label Label3
- 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 = 480
- TabIndex = 2
- Top = 1560
- Width = 855
- End
- Begin VB.Label Label2
- 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 = 480
- TabIndex = 1
- Top = 840
- Width = 855
- 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 = 480
- TabIndex = 0
- Top = 120
- Width = 1455
- End
- End
- Attribute VB_Name = "zl_tjForm"
- 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
- Dim da As Date
- zl_tjAdodc.Recordset.MoveFirst
- For i = 0 To zl_tjAdodc.Recordset.RecordCount - 1 Step 1
- If zl_tjAdodc.Recordset.Fields(0).Value = Text1.Text Then
- MsgBox "该记录以存在!!", 64
- Exit Sub
- Else
- zl_tjAdodc.Recordset.MoveNext
- End If
- If i = zl_tjAdodc.Recordset.RecordCount - 1 Then
- '该记录不存在 开始添加
- zl_tjAdodc.Recordset.AddNew
- zl_tjAdodc.Recordset.Fields(0) = Text1.Text
- zl_tjAdodc.Recordset.Fields(1) = Text2.Text
- zl_tjAdodc.Recordset.Fields(2) = Int(Val(Text3.Text))
- zl_tjAdodc.Recordset.Fields(3) = Text4.Text
- '把文本转换问Date型
- da = Text5.Text
- zl_tjAdodc.Recordset.Fields(4) = da
- zl_tjAdodc.Recordset.Fields(5) = Text6.Text
- zl_tjAdodc.Recordset.Update
- MsgBox "该记录以添加!", 64, "友情提示"
- End If
- Next i
- End Sub
- Private Sub Command2_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- Dim revalu As Long
- revalu = SetWindowPos(zl_tjForm.hwnd, HWND_TOPMOST, Me.CurrentX, Me.CurrentY, _
- 1 / 15 * Me.Width, 1 / 15 * Me.Height, SWP_SHOWWINDOW)
- '连接数据库
- zl_tjForm.Left = (Screen.Width - zl_tjForm.Width) / 2
- zl_tjForm.Top = (Screen.Height - zl_tjForm.Height) / 2
- Call lind_zldbti
- zl_tjAdodc.Visible = False
- DataGrid1.Visible = False
- End Sub
- Sub lind_zldbti()
- 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_tjAdodc.ConnectionString = dbpath
- zl_tjAdodc.CommandType = adCmdText
- zl_tjAdodc.RecordSource = "select * from 驾驶员资料表"
- '动态连接数据库时一定要刷新数据库
- zl_tjAdodc.Refresh
- End Sub
- Private Sub Label7_Click()
- End Sub