yh_qxForm.frm
资源名称:七八个vb游戏.rar [点击查看]
上传用户:tashmp
上传日期:2010-04-03
资源大小:882k
文件大小:9k
源码类别:
其他游戏
开发平台:
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 yh_qxForm
- BackColor = &H00FFC0C0&
- BorderStyle = 1 'Fixed Single
- Caption = "用户权限管理修改"
- ClientHeight = 3105
- ClientLeft = 45
- ClientTop = 375
- ClientWidth = 5910
- Icon = "yh_qxForm.frx":0000
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3105
- ScaleWidth = 5910
- StartUpPosition = 3 'Windows Default
- Begin MSDataGridLib.DataGrid DataGrid1
- Bindings = "yh_qxForm.frx":030A
- Height = 735
- Left = 3720
- TabIndex = 6
- Top = 960
- Width = 1935
- _ExtentX = 3413
- _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 thqxAdodc
- Height = 330
- Left = 0
- Top = 1080
- Width = 1200
- _ExtentX = 2117
- _ExtentY = 582
- 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 Command2
- BackColor = &H00FFC0C0&
- Caption = "取消"
- Height = 495
- Left = 3600
- Style = 1 'Graphical
- TabIndex = 5
- Top = 2400
- Width = 1575
- End
- Begin VB.CommandButton Command1
- BackColor = &H00FFC0C0&
- Caption = "添加"
- Height = 495
- Left = 960
- Style = 1 'Graphical
- TabIndex = 4
- Top = 2400
- Width = 1575
- 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
- IMEMode = 3 'DISABLE
- Left = 1920
- PasswordChar = "*"
- TabIndex = 3
- Top = 1560
- Width = 2295
- 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 = 1920
- TabIndex = 2
- Top = 480
- Width = 2295
- End
- Begin VB.Image Image2
- Height = 480
- Left = 4680
- Picture = "yh_qxForm.frx":0322
- Top = 480
- Width = 480
- End
- Begin VB.Image Image1
- Height = 720
- Left = 4680
- Picture = "yh_qxForm.frx":0BEC
- Top = 1440
- Width = 720
- 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 = 1
- Top = 1560
- Width = 855
- 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 = 480
- TabIndex = 0
- Top = 480
- Width = 975
- End
- End
- Attribute VB_Name = "yh_qxForm"
- 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
- If Text1 <> "" And Text2 <> "" Then
- thqxAdodc.Recordset.MoveFirst
- For i = 0 To thqxAdodc.Recordset.RecordCount - 1 Step 1
- If thqxAdodc.Recordset.Fields(0).Value = Text1.Text Then
- MsgBox "该记录以存在!!", 64
- Exit Sub
- Else
- thqxAdodc.Recordset.MoveNext
- End If
- If i = thqxAdodc.Recordset.RecordCount - 1 Then
- '该记录不存在 开始添加
- thqxAdodc.Recordset.AddNew
- thqxAdodc.Recordset.Fields(0).Value = Text1.Text
- thqxAdodc.Recordset.Fields(1).Value = Text2.Text
- thqxAdodc.Recordset.Update
- MsgBox "该记录以添加!", 64, "友情提示"
- End If
- Next i
- Else
- MsgBox "请输入用户名和密码", 48, "友情提示"
- End If
- End Sub
- Private Sub Command2_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- Dim revalu As Long
- thqxAdodc.Visible = False
- DataGrid1.Visible = False
- revalu = SetWindowPos(yh_qxForm.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_yhqx_db
- End Sub
- '连接数据库
- Sub lind_yhqx_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"
- thqxAdodc.ConnectionString = dbpath
- thqxAdodc.CommandType = adCmdText
- thqxAdodc.RecordSource = "select * from 用户权限表"
- '动态连接数据库时一定要刷新数据库
- thqxAdodc.Refresh
- End Sub