chpwd.frm
上传用户:laihaixin
上传日期:2013-01-26
资源大小:1169k
文件大小:7k
源码类别:

医药行业

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
  3. Begin VB.Form chpwd 
  4.    BackColor       =   &H00404040&
  5.    BorderStyle     =   3  'Fixed Dialog
  6.    Caption         =   "用户修改密码"
  7.    ClientHeight    =   3075
  8.    ClientLeft      =   45
  9.    ClientTop       =   330
  10.    ClientWidth     =   4680
  11.    Icon            =   "chpwd.frx":0000
  12.    LinkTopic       =   "Form1"
  13.    LockControls    =   -1  'True
  14.    MaxButton       =   0   'False
  15.    MDIChild        =   -1  'True
  16.    MinButton       =   0   'False
  17.    Picture         =   "chpwd.frx":030A
  18.    ScaleHeight     =   3075
  19.    ScaleWidth      =   4680
  20.    ShowInTaskbar   =   0   'False
  21.    Begin VB.PictureBox Picture2 
  22.       Height          =   1095
  23.       Left            =   240
  24.       Picture         =   "chpwd.frx":59F9
  25.       ScaleHeight     =   1035
  26.       ScaleWidth      =   4155
  27.       TabIndex        =   8
  28.       Top             =   1440
  29.       Width           =   4215
  30.       Begin VB.Label Label3 
  31.          BackColor       =   &H00404040&
  32.          BackStyle       =   0  'Transparent
  33.          Caption         =   "    密码最多只能输入20个英文字符或10个汉字或20个数字,不能输入其它标点符号或怪字符。建议密码不要使用汉字。"
  34.          ForeColor       =   &H00000000&
  35.          Height          =   615
  36.          Left            =   360
  37.          TabIndex        =   9
  38.          Top             =   240
  39.          Width           =   3495
  40.       End
  41.    End
  42.    Begin VB.PictureBox Picture1 
  43.       Height          =   1215
  44.       Left            =   240
  45.       Picture         =   "chpwd.frx":7DDC
  46.       ScaleHeight     =   1155
  47.       ScaleWidth      =   4155
  48.       TabIndex        =   1
  49.       Top             =   120
  50.       Width           =   4215
  51.       Begin VB.TextBox Text1 
  52.          BackColor       =   &H00FFFFFF&
  53.          ForeColor       =   &H000000FF&
  54.          Height          =   270
  55.          IMEMode         =   3  'DISABLE
  56.          Left            =   960
  57.          PasswordChar    =   "*"
  58.          TabIndex        =   5
  59.          Top             =   240
  60.          Width           =   1095
  61.       End
  62.       Begin VB.TextBox Text2 
  63.          BackColor       =   &H00FFFFFF&
  64.          ForeColor       =   &H000000FF&
  65.          Height          =   270
  66.          IMEMode         =   3  'DISABLE
  67.          Left            =   960
  68.          PasswordChar    =   "*"
  69.          TabIndex        =   4
  70.          Top             =   600
  71.          Width           =   1095
  72.       End
  73.       Begin VB.CommandButton Command1 
  74.          Caption         =   "确定&(O)"
  75.          Height          =   300
  76.          Left            =   3000
  77.          TabIndex        =   3
  78.          Top             =   240
  79.          Width           =   1000
  80.       End
  81.       Begin VB.CommandButton Command2 
  82.          Caption         =   "取消&(C)"
  83.          Height          =   300
  84.          Left            =   3000
  85.          TabIndex        =   2
  86.          Top             =   600
  87.          Width           =   1000
  88.       End
  89.       Begin VB.Label Label1 
  90.          AutoSize        =   -1  'True
  91.          BackColor       =   &H00404040&
  92.          BackStyle       =   0  'Transparent
  93.          Caption         =   "旧密码:"
  94.          ForeColor       =   &H00000000&
  95.          Height          =   180
  96.          Left            =   240
  97.          TabIndex        =   7
  98.          Top             =   285
  99.          Width           =   630
  100.       End
  101.       Begin VB.Label Label2 
  102.          AutoSize        =   -1  'True
  103.          BackColor       =   &H00404040&
  104.          BackStyle       =   0  'Transparent
  105.          Caption         =   "新密码:"
  106.          ForeColor       =   &H00000000&
  107.          Height          =   180
  108.          Left            =   240
  109.          TabIndex        =   6
  110.          Top             =   645
  111.          Width           =   630
  112.       End
  113.    End
  114.    Begin MSAdodcLib.Adodc Adodc1 
  115.       Height          =   330
  116.       Left            =   360
  117.       Top             =   2640
  118.       Visible         =   0   'False
  119.       Width           =   1200
  120.       _ExtentX        =   2117
  121.       _ExtentY        =   582
  122.       ConnectMode     =   0
  123.       CursorLocation  =   3
  124.       IsolationLevel  =   -1
  125.       ConnectionTimeout=   15
  126.       CommandTimeout  =   30
  127.       CursorType      =   3
  128.       LockType        =   3
  129.       CommandType     =   8
  130.       CursorOptions   =   0
  131.       CacheSize       =   50
  132.       MaxRecords      =   0
  133.       BOFAction       =   0
  134.       EOFAction       =   0
  135.       ConnectStringType=   1
  136.       Appearance      =   1
  137.       BackColor       =   -2147483643
  138.       ForeColor       =   -2147483640
  139.       Orientation     =   0
  140.       Enabled         =   -1
  141.       Connect         =   ""
  142.       OLEDBString     =   ""
  143.       OLEDBFile       =   ""
  144.       DataSourceName  =   ""
  145.       OtherAttributes =   ""
  146.       UserName        =   ""
  147.       Password        =   ""
  148.       RecordSource    =   ""
  149.       Caption         =   "Adodc1"
  150.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  151.          Name            =   "宋体"
  152.          Size            =   9
  153.          Charset         =   134
  154.          Weight          =   400
  155.          Underline       =   0   'False
  156.          Italic          =   0   'False
  157.          Strikethrough   =   0   'False
  158.       EndProperty
  159.       _Version        =   393216
  160.    End
  161.    Begin VB.CommandButton Command3 
  162.       Caption         =   "关闭&(Q)"
  163.       Height          =   300
  164.       Left            =   3250
  165.       TabIndex        =   0
  166.       Top             =   2670
  167.       Width           =   1000
  168.    End
  169. End
  170. Attribute VB_Name = "chpwd"
  171. Attribute VB_GlobalNameSpace = False
  172. Attribute VB_Creatable = False
  173. Attribute VB_PredeclaredId = True
  174. Attribute VB_Exposed = False
  175. Private Sub Command1_Click()
  176. On Error GoTo err1
  177. username = frmlogin.username
  178. If Text1.Text <> "" And Text2.Text <> "" Then
  179. Adodc1.RecordSource = "select * from usertab where 用户名='" & username & "' and  密码=" & "'" & Text1.Text & "'"
  180. Adodc1.Refresh
  181. If Adodc1.Recordset.AbsolutePosition = adPosUnknown Then
  182. MsgBox "旧密码错误!"
  183. Text1.Text = ""
  184. Text2.Text = ""
  185. Text1.SetFocus
  186. Else
  187. Adodc1.Recordset.Fields("密码") = Text2.Text
  188. Adodc1.Recordset.Update
  189. MsgBox "密码修改成功!"
  190. Text1.Text = ""
  191. Text2.Text = ""
  192. End If
  193. Else
  194. MsgBox "新旧密码均不得为空!"
  195. Text1.SetFocus
  196. End If
  197. Exit Sub
  198. err1:
  199. MsgBox "远程服务器连接失败!"
  200. End Sub
  201. Private Sub Command2_Click()
  202. Text1.Text = ""
  203. Text2.Text = ""
  204. Text1.SetFocus
  205. End Sub
  206. Private Sub Command3_Click()
  207. Unload Me
  208. End Sub
  209. Private Sub Form_Load()
  210. On Error GoTo err2
  211. chpwd.Top = (frmmain.Height - chpwd.Height) / 2 - 500
  212. chpwd.Left = (frmmain.Width - chpwd.Width) / 2
  213. Adodc1.ConnectionString = frmlogin.conn
  214. Text1.Text = ""
  215. Text2.Text = ""
  216. Exit Sub
  217. err2:
  218. MsgBox "远程服务器连接失败!"
  219. End Sub
  220. Private Sub Form_Unload(Cancel As Integer)
  221. frmmain.StatusBar1.Panels(2) = "目前没有窗口被激活"
  222. End Sub
  223. Private Sub Form_Activate()
  224. frmmain.StatusBar1.Panels(2) = "活动窗口:" & chpwd.Caption
  225. End Sub