ns_tjForm.frm
资源名称:七八个vb游戏.rar [点击查看]
上传用户:tashmp
上传日期:2010-04-03
资源大小:882k
文件大小:10k
源码类别:
其他游戏
开发平台:
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 ns_tjForm
- BackColor = &H00FFC0C0&
- Caption = "年审评定"
- ClientHeight = 6465
- ClientLeft = 60
- ClientTop = 390
- ClientWidth = 9390
- Icon = "ns_tjForm.frx":0000
- LinkTopic = "Form1"
- ScaleHeight = 6465
- ScaleWidth = 9390
- StartUpPosition = 3 'Windows Default
- Begin MSDataGridLib.DataGrid DataGrid1
- Bindings = "ns_tjForm.frx":0442
- Height = 855
- Left = 5400
- TabIndex = 9
- Top = 1920
- Width = 3375
- _ExtentX = 5953
- _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 ns_tjAdodc
- Height = 495
- Left = 5400
- Top = 240
- 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 = "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.CommandButton Command1
- BackColor = &H00FFC0C0&
- Caption = "添加记录"
- Height = 975
- Left = 5400
- Style = 1 'Graphical
- TabIndex = 8
- Top = 840
- Width = 1815
- End
- Begin VB.Frame Frame1
- BackColor = &H00FFC0C0&
- Caption = "年审评定"
- Height = 3495
- Left = 240
- TabIndex = 6
- Top = 2760
- Width = 9015
- Begin VB.TextBox Text4
- BackColor = &H00FFFFFF&
- Height = 3135
- Left = 240
- MultiLine = -1 'True
- TabIndex = 7
- Top = 240
- Width = 8655
- End
- 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 = 2040
- TabIndex = 5
- Top = 1920
- Width = 2895
- 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 = 2040
- TabIndex = 3
- Top = 1080
- Width = 2895
- End
- Begin VB.TextBox Text1
- 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 = 2040
- TabIndex = 1
- Top = 240
- Width = 2895
- End
- Begin VB.Image Image1
- Height = 480
- Left = 7920
- Picture = "ns_tjForm.frx":045B
- Top = 960
- Width = 480
- 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 = 360
- TabIndex = 4
- Top = 1920
- Width = 1335
- 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 = 360
- TabIndex = 2
- Top = 1080
- Width = 1335
- 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 = 0
- Top = 240
- Width = 1335
- End
- End
- Attribute VB_Name = "ns_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
- ns_tjAdodc.Recordset.MoveFirst
- For i = 0 To ns_tjAdodc.Recordset.RecordCount - 1 Step 1
- If ns_tjAdodc.Recordset.Fields(0).Value = Text1.Text Then
- MsgBox "该记录以存在!!", 64, "友情提示"
- Exit Sub
- Else
- ns_tjAdodc.Recordset.MoveNext
- End If
- If i = ns_tjAdodc.Recordset.RecordCount - 1 Then
- '该记录不存在 开始添加
- ns_tjAdodc.Recordset.AddNew
- ns_tjAdodc.Recordset.Fields(0).Value = Text1
- ns_tjAdodc.Recordset.Fields(1).Value = Text2
- ns_tjAdodc.Recordset.Fields(2).Value = Text3
- ns_tjAdodc.Recordset.Fields(3).Value = Text4
- ns_tjAdodc.Recordset.Update
- MsgBox "该记录以添加!", 64, "友情提示"
- End If
- Next i
- End Sub
- Private Sub Form_Load()
- Dim revalu As Long
- ns_tjAdodc.Visible = False
- DataGrid1.Visible = False
- 'Me.Show '显示窗题
- '连接驾驶员资料表
- revalu = SetWindowPos(ns_tjForm.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_nstj_db
- End Sub
- '连接数据库
- Sub lind_nstj_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"
- ns_tjAdodc.ConnectionString = dbpath
- ns_tjAdodc.CommandType = adCmdText
- ns_tjAdodc.RecordSource = "select * from 年审评定表"
- '动态连接数据库时一定要刷新数据库
- ns_tjAdodc.Refresh
- End Sub