?? form3.frm
字號:
Height = 255
Left = 240
TabIndex = 22
Top = 600
Width = 975
End
Begin VB.Label Label6
Caption = "關 鍵 字"
Height = 255
Left = 240
TabIndex = 20
Top = 360
Width = 855
End
End
Begin VB.Frame Frame5
Caption = "串口設置(&B)"
Height = 1695
Left = 120
TabIndex = 3
Top = 2160
Width = 2295
Begin VB.ComboBox Combo5
Height = 300
ItemData = "Form3.frx":1D06
Left = 1080
List = "Form3.frx":1D22
TabIndex = 38
Text = "1"
Top = 1320
Width = 855
End
Begin VB.ComboBox Combo4
Height = 300
ItemData = "Form3.frx":1D3E
Left = 1080
List = "Form3.frx":1D4E
TabIndex = 37
Text = "7"
Top = 960
Width = 855
End
Begin VB.ComboBox Combo3
Height = 300
ItemData = "Form3.frx":1D5E
Left = 1080
List = "Form3.frx":1D68
TabIndex = 36
Text = "e"
Top = 600
Width = 855
End
Begin VB.ComboBox Combo2
Height = 300
ItemData = "Form3.frx":1D72
Left = 1080
List = "Form3.frx":1D85
TabIndex = 35
Text = "9600"
Top = 240
Width = 855
End
Begin VB.Label Label14
Caption = "停 止 位"
Height = 255
Left = 240
TabIndex = 34
Top = 1320
Width = 735
End
Begin VB.Label Label13
Caption = "數 據 位"
Height = 255
Left = 240
TabIndex = 33
Top = 960
Width = 735
End
Begin VB.Label Label12
Caption = "奇偶校驗"
Height = 255
Left = 240
TabIndex = 32
Top = 600
Width = 735
End
Begin VB.Label Label11
Caption = "波 特 率"
Height = 255
Left = 240
TabIndex = 31
Top = 240
Width = 735
End
End
Begin VB.Label Label3
Caption = "默認參數:"
Height = 255
Left = 240
TabIndex = 7
Top = 240
Width = 975
End
End
Begin VB.Label Label10
BorderStyle = 1 'Fixed Single
Height = 1095
Left = 240
TabIndex = 30
Top = 2880
Width = 2415
End
Begin VB.Label Label2
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "5212117"
BeginProperty Font
Name = "宋體"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FF0000&
Height = 615
Left = 240
TabIndex = 5
Top = 360
Width = 2415
End
End
Begin VB.Label Label1
Caption = "Label1"
Height = 495
Left = 7560
TabIndex = 6
Top = 6960
Visible = 0 'False
Width = 975
End
Begin VB.Menu caidan
Caption = "菜單(&O)"
Index = 0
Begin VB.Menu genggai
Caption = "更改用戶(&C)"
Index = 1
End
Begin VB.Menu tuichu
Caption = "退出(&X)"
Index = 2
End
End
Begin VB.Menu jbzl
Caption = "基本資料(&J)"
Index = 6
End
Begin VB.Menu shj
Caption = "系統設置(&S)"
Index = 6
End
Begin VB.Menu bangzhu
Caption = "幫助(&H)"
Index = 3
Begin VB.Menu shiyong
Caption = "使用幫助"
Index = 4
Shortcut = {F1}
End
Begin VB.Menu guanyu
Caption = "關于軟件"
Index = 5
End
End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'****************************************************************************
'人人為我,我為人人
'枕善居收藏整理
'發布日期:2007/09/06
'描 述:地磅稱重管理軟件 beta 1.0
'網 站:http://www.Mndsoft.com/ (VB6源碼博客)
'網 站:http://www.VbDnet.com/ (VB.NET源碼博客,主要基于.NET2005)
'e-mail :Mndsoft@163.com
'e-mail :Mndsoft@126.com
'OICQ :88382850
' 如果您有新的好的代碼別忘記給枕善居哦!
'****************************************************************************
Dim cnnUser As New ADODB.Connection
Dim rstUser As New ADODB.Recordset
Private Sub Command1_Click()
Dim xname As String
Dim tmpop As String
If List1.List(List1.ListIndex) <> "" Then
tmpop = MsgBox("確定刪除?", vbOKCancel, "提示:")
If tmpop = 1 Then
xname = Trim(List1.List(List1.ListIndex))
cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\db.mpp;" & _
"Mode= ReadWrite | Share Deny None"
cnnUser.Open
With rstUser
Set .ActiveConnection = cnnUser
.CursorType = adOpenKeyset 'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他兩個屬性不行
End With
With rstUser
If .State = adOpenKeyset Then .Close
.Open "select * from [admin] where [name]='" & xname & "'", cnnUser, adOpenKeyset, adLockOptimistic
.Delete
.Update
.Close
End With
cnnUser.Close
List1.Clear
List2.Clear
data
End If
Else
MsgBox "請選擇用戶!", vbOKOnly, "提示:"
End If
End Sub
Private Sub data()
Dim cc As String
Dim i As Integer
Dim dd As String
cc = Label1.Caption
cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\db.mpp"
cnnUser.Open
With rstUser
Set .ActiveConnection = cnnUser
.CursorType = adOpenKeyset 'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他兩個屬性不行
End With
With rstUser
If .State = adStateOpen Then .Close
.Open ("Select * from admin")
Do While Not .EOF
dd = ""
If rstUser.Fields("adm").Value = 1 Then
dd = "是"
End If
If rstUser.Fields("name").Value <> "admin" Then
List1.AddItem " " & rstUser.Fields("name").Value
List2.AddItem " " & dd
End If
.MoveNext
Loop
End With
cnnUser.Close
End Sub
Private Sub Command10_Click()
If tt2.Text <> "" Then
cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\db.mpp"
cnnUser.Open
With rstUser
Set .ActiveConnection = cnnUser
.CursorType = adOpenKeyset 'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他兩個屬性不行
End With
With rstUser
If .State = adStateOpen Then .Close
.Open "Select * from [jingyinghu] where jingying = '" & tt2.Text & "'"
If Not .EOF Then
MsgBox "數據已存在!", vbOKOnly, "提示:"
tt2.Text = ""
.Close
cnnUser.Close
Exit Sub
End If
.Close
End With
With rstUser
If .State = adStateOpen Then .Close
.Open "Select * from [jingyinghu]", cnnUser, adOpenKeyset, adLockOptimistic
.AddNew
![jingying] = tt2.Text
.Update
.Close
End With
cnnUser.Close
Call ddt
Else
MsgBox "請填寫內容!", vbOKOnly, "提示:"
End If
tt2.Text = ""
End Sub
Private Sub Command11_Click()
If tt3.Text <> "" Then
cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\db.mpp"
cnnUser.Open
With rstUser
Set .ActiveConnection = cnnUser
.CursorType = adOpenKeyset 'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他兩個屬性不行
End With
With rstUser
If .State = adStateOpen Then .Close
.Open "Select * from [fahuo] where fahuo = '" & tt3.Text & "'"
If Not .EOF Then
MsgBox "數據已存在!", vbOKOnly, "提示:"
tt3.Text = ""
.Close
cnnUser.Close
Exit Sub
End If
.Close
End With
With rstUser
If .State = adStateOpen Then .Close
.Open "Select * from [fahuo]", cnnUser, adOpenKeyset, adLockOptimistic
.AddNew
![fahuo] = tt3.Text
.Update
.Close
End With
cnnUser.Close
Call ddt
Else
MsgBox "請填寫內容!", vbOKOnly, "提示:"
End If
tt3.Text = ""
End Sub
Private Sub Command2_Click()
Dim xname As String
xname = Form3.txtname.Text
cnnUser.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & App.Path & "\db.mpp;" & _
"Mode= ReadWrite | Share Deny None"
cnnUser.Open
With rstUser
Set .ActiveConnection = cnnUser
.CursorType = adOpenKeyset 'adOpenKeyset,adOpenStatic可使用Recordset的RecordCount,其他兩個屬性不行
End With
With rstUser
If .State = adOpenKeyset Then .Close
.Open "select * from [admin] where [name]='" & xname & "'", cnnUser, adOpenKeyset, adLockOptimistic
If Not .EOF Then
If decipher(rstUser.Fields("password").Value) <> Form3.txtyuan.Text Then
MsgBox "原密碼不正確!", vbOKOnly, "錯誤:"
cnnUser.Close
txtyuan.Text = ""
Exit Sub
End If
Else
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -