gly_qxForm.frm
上传用户:tashmp
上传日期:2010-04-03
资源大小:882k
文件大小:9k
源码类别:

其他游戏

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
  3. Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
  4. Begin VB.Form gly_qxForm 
  5.    BackColor       =   &H00FFC0C0&
  6.    BorderStyle     =   1  'Fixed Single
  7.    Caption         =   "管理员权限管理"
  8.    ClientHeight    =   3180
  9.    ClientLeft      =   45
  10.    ClientTop       =   375
  11.    ClientWidth     =   6795
  12.    Icon            =   "gly_qxForm.frx":0000
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3180
  17.    ScaleWidth      =   6795
  18.    StartUpPosition =   3  'Windows Default
  19.    Begin MSDataGridLib.DataGrid DataGrid1 
  20.       Bindings        =   "gly_qxForm.frx":08CA
  21.       Height          =   615
  22.       Left            =   3360
  23.       TabIndex        =   6
  24.       Top             =   840
  25.       Width           =   3255
  26.       _ExtentX        =   5741
  27.       _ExtentY        =   1085
  28.       _Version        =   393216
  29.       HeadLines       =   1
  30.       RowHeight       =   15
  31.       BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  32.          Name            =   "MS Sans Serif"
  33.          Size            =   8.25
  34.          Charset         =   0
  35.          Weight          =   400
  36.          Underline       =   0   'False
  37.          Italic          =   0   'False
  38.          Strikethrough   =   0   'False
  39.       EndProperty
  40.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  41.          Name            =   "MS Sans Serif"
  42.          Size            =   8.25
  43.          Charset         =   0
  44.          Weight          =   400
  45.          Underline       =   0   'False
  46.          Italic          =   0   'False
  47.          Strikethrough   =   0   'False
  48.       EndProperty
  49.       ColumnCount     =   2
  50.       BeginProperty Column00 
  51.          DataField       =   ""
  52.          Caption         =   ""
  53.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  54.             Type            =   0
  55.             Format          =   ""
  56.             HaveTrueFalseNull=   0
  57.             FirstDayOfWeek  =   0
  58.             FirstWeekOfYear =   0
  59.             LCID            =   2052
  60.             SubFormatType   =   0
  61.          EndProperty
  62.       EndProperty
  63.       BeginProperty Column01 
  64.          DataField       =   ""
  65.          Caption         =   ""
  66.          BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
  67.             Type            =   0
  68.             Format          =   ""
  69.             HaveTrueFalseNull=   0
  70.             FirstDayOfWeek  =   0
  71.             FirstWeekOfYear =   0
  72.             LCID            =   2052
  73.             SubFormatType   =   0
  74.          EndProperty
  75.       EndProperty
  76.       SplitCount      =   1
  77.       BeginProperty Split0 
  78.          BeginProperty Column00 
  79.          EndProperty
  80.          BeginProperty Column01 
  81.          EndProperty
  82.       EndProperty
  83.    End
  84.    Begin MSAdodcLib.Adodc gly_qxAdodc 
  85.       Height          =   495
  86.       Left            =   480
  87.       Top             =   840
  88.       Width           =   1200
  89.       _ExtentX        =   2117
  90.       _ExtentY        =   873
  91.       ConnectMode     =   0
  92.       CursorLocation  =   3
  93.       IsolationLevel  =   -1
  94.       ConnectionTimeout=   15
  95.       CommandTimeout  =   30
  96.       CursorType      =   3
  97.       LockType        =   3
  98.       CommandType     =   8
  99.       CursorOptions   =   0
  100.       CacheSize       =   50
  101.       MaxRecords      =   0
  102.       BOFAction       =   0
  103.       EOFAction       =   0
  104.       ConnectStringType=   1
  105.       Appearance      =   1
  106.       BackColor       =   -2147483643
  107.       ForeColor       =   -2147483640
  108.       Orientation     =   0
  109.       Enabled         =   -1
  110.       Connect         =   ""
  111.       OLEDBString     =   ""
  112.       OLEDBFile       =   ""
  113.       DataSourceName  =   ""
  114.       OtherAttributes =   ""
  115.       UserName        =   ""
  116.       Password        =   ""
  117.       RecordSource    =   ""
  118.       Caption         =   ""
  119.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  120.          Name            =   "MS Sans Serif"
  121.          Size            =   8.25
  122.          Charset         =   0
  123.          Weight          =   400
  124.          Underline       =   0   'False
  125.          Italic          =   0   'False
  126.          Strikethrough   =   0   'False
  127.       EndProperty
  128.       _Version        =   393216
  129.    End
  130.    Begin VB.CommandButton Command2 
  131.       BackColor       =   &H00FFC0C0&
  132.       Caption         =   "取消"
  133.       Height          =   495
  134.       Left            =   4320
  135.       Style           =   1  'Graphical
  136.       TabIndex        =   5
  137.       Top             =   2520
  138.       Width           =   1575
  139.    End
  140.    Begin VB.CommandButton Command1 
  141.       BackColor       =   &H00FFC0C0&
  142.       Caption         =   "添加"
  143.       Height          =   495
  144.       Left            =   480
  145.       Style           =   1  'Graphical
  146.       TabIndex        =   4
  147.       Top             =   2520
  148.       Width           =   1575
  149.    End
  150.    Begin VB.TextBox Text2 
  151.       BackColor       =   &H00FFC0C0&
  152.       BeginProperty Font 
  153.          Name            =   "MS Sans Serif"
  154.          Size            =   12
  155.          Charset         =   0
  156.          Weight          =   700
  157.          Underline       =   0   'False
  158.          Italic          =   0   'False
  159.          Strikethrough   =   0   'False
  160.       EndProperty
  161.       Height          =   495
  162.       IMEMode         =   3  'DISABLE
  163.       Left            =   2400
  164.       PasswordChar    =   "*"
  165.       TabIndex        =   3
  166.       Top             =   1560
  167.       Width           =   2775
  168.    End
  169.    Begin VB.TextBox Text1 
  170.       BackColor       =   &H00FFC0C0&
  171.       BeginProperty Font 
  172.          Name            =   "MS Sans Serif"
  173.          Size            =   12
  174.          Charset         =   0
  175.          Weight          =   700
  176.          Underline       =   0   'False
  177.          Italic          =   0   'False
  178.          Strikethrough   =   0   'False
  179.       EndProperty
  180.       Height          =   495
  181.       Left            =   2400
  182.       TabIndex        =   2
  183.       Top             =   360
  184.       Width           =   2775
  185.    End
  186.    Begin VB.Image Image2 
  187.       Height          =   720
  188.       Left            =   5640
  189.       Picture         =   "gly_qxForm.frx":08E4
  190.       Top             =   1440
  191.       Width           =   720
  192.    End
  193.    Begin VB.Image Image1 
  194.       Height          =   480
  195.       Left            =   5640
  196.       Picture         =   "gly_qxForm.frx":2066
  197.       Top             =   360
  198.       Width           =   480
  199.    End
  200.    Begin VB.Label Label2 
  201.       BackColor       =   &H00FFC0C0&
  202.       Caption         =   "管理员登密码:"
  203.       BeginProperty Font 
  204.          Name            =   "MS Sans Serif"
  205.          Size            =   12
  206.          Charset         =   0
  207.          Weight          =   700
  208.          Underline       =   0   'False
  209.          Italic          =   0   'False
  210.          Strikethrough   =   0   'False
  211.       EndProperty
  212.       Height          =   375
  213.       Left            =   240
  214.       TabIndex        =   1
  215.       Top             =   1560
  216.       Width           =   1695
  217.    End
  218.    Begin VB.Label Label1 
  219.       BackColor       =   &H00FFC0C0&
  220.       Caption         =   "管理员登陆名:"
  221.       BeginProperty Font 
  222.          Name            =   "MS Sans Serif"
  223.          Size            =   12
  224.          Charset         =   0
  225.          Weight          =   700
  226.          Underline       =   0   'False
  227.          Italic          =   0   'False
  228.          Strikethrough   =   0   'False
  229.       EndProperty
  230.       Height          =   375
  231.       Left            =   240
  232.       TabIndex        =   0
  233.       Top             =   360
  234.       Width           =   1815
  235.    End
  236. End
  237. Attribute VB_Name = "gly_qxForm"
  238. Attribute VB_GlobalNameSpace = False
  239. Attribute VB_Creatable = False
  240. Attribute VB_PredeclaredId = True
  241. Attribute VB_Exposed = False
  242. Option Explicit
  243. '添加管理员记录
  244. Private Sub Command1_Click()
  245.  Dim i As Integer
  246.  If Text1 <> "" And Text2 <> "" Then
  247. gly_qxAdodc.Recordset.MoveFirst
  248. For i = 0 To gly_qxAdodc.Recordset.RecordCount - 1 Step 1
  249.   If gly_qxAdodc.Recordset.Fields(0).Value = Text1.Text Then
  250.    
  251.    MsgBox "该记录以存在!!", 64
  252.    Exit Sub
  253.    Else
  254.    gly_qxAdodc.Recordset.MoveNext
  255.    End If
  256.    If i = gly_qxAdodc.Recordset.RecordCount - 1 Then
  257.    '该记录不存在 开始添加
  258.    
  259.    gly_qxAdodc.Recordset.AddNew
  260.     gly_qxAdodc.Recordset.Fields(0).Value = Text1.Text
  261.       gly_qxAdodc.Recordset.Fields(1).Value = Text2.Text
  262.     gly_qxAdodc.Recordset.Update
  263.     MsgBox "该记录以添加!", 64, "友情提示"
  264.   End If
  265. Next i
  266. Else
  267. MsgBox "请输入用户名和密码", 48, "友情提示"
  268. End If
  269. End Sub
  270. Private Sub Command2_Click()
  271. Unload Me
  272. End Sub
  273. Private Sub Form_Load()
  274.  Dim revalu As Long
  275.  gly_qxAdodc.Visible = False
  276.  DataGrid1.Visible = False
  277.  revalu = SetWindowPos(gly_qxForm.hwnd, HWND_TOPMOST, Me.CurrentX, Me.CurrentY, _
  278.     1 / 15 * Me.Width, 1 / 15 * Me.Height, SWP_SHOWWINDOW)
  279.   
  280.    Me.Left = (Screen.Width - Me.Width) / 2 - 150
  281.    Me.Top = (Screen.Height - Me.Height) / 2 - 150
  282.    Call lind_gly_db
  283. End Sub
  284. '连接数据库
  285. Sub lind_gly_db()
  286. Dim dbpath As String
  287.  
  288. If Right(App.Path, 1) <> "" Then
  289. dbpath = App.Path & ""
  290. Else
  291. dbpath = App.Path
  292. End If
  293.  
  294.  '以管理员登陆
  295.  'MsgBox "gly"
  296. dbpath = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False; Data Source=" & dbpath & "年审评定数据库.mdb"
  297. gly_qxAdodc.ConnectionString = dbpath
  298. gly_qxAdodc.CommandType = adCmdText
  299. gly_qxAdodc.RecordSource = "select * from  管理员权限表"
  300. '动态连接数据库时一定要刷新数据库
  301. gly_qxAdodc.Refresh
  302. End Sub