📄 frmphry.frm
字号:
VERSION 5.00
Begin VB.Form frmPHry
Caption = "人员录入"
ClientHeight = 2715
ClientLeft = 60
ClientTop = 345
ClientWidth = 5100
LinkTopic = "Form1"
MaxButton = 0 'False
ScaleHeight = 2715
ScaleWidth = 5100
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Height = 2595
Left = 90
TabIndex = 0
Top = 0
Width = 4905
Begin VB.ComboBox Combo1
Height = 300
Left = 1950
TabIndex = 9
Top = 420
Width = 2535
End
Begin VB.CommandButton Command1
Height = 315
Left = 960
Picture = "frmPHry.frx":0000
Style = 1 'Graphical
TabIndex = 5
Top = 2010
Width = 1275
End
Begin VB.CommandButton Command2
Height = 315
Left = 2910
Picture = "frmPHry.frx":025E
Style = 1 'Graphical
TabIndex = 4
Top = 2010
Width = 1215
End
Begin VB.TextBox Text3
Height = 285
Left = 1950
TabIndex = 3
Top = 1290
Width = 2835
End
Begin VB.TextBox Text2
Height = 285
Left = 1950
TabIndex = 2
Top = 840
Width = 1425
End
Begin VB.PictureBox Picture1
BorderStyle = 0 'None
Height = 615
Left = 90
Picture = "frmPHry.frx":04F4
ScaleHeight = 615
ScaleWidth = 645
TabIndex = 1
Top = 330
Width = 645
End
Begin VB.Label Label1
Caption = "编 号"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 2
Left = 780
TabIndex = 8
Top = 1320
Width = 1095
End
Begin VB.Label Label1
Caption = "姓 名"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 1
Left = 780
TabIndex = 7
Top = 870
Width = 1065
End
Begin VB.Label Label1
Caption = "类 别"
BeginProperty Font
Name = "宋体"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 225
Index = 0
Left = 780
TabIndex = 6
Top = 450
Width = 1125
End
End
End
Attribute VB_Name = "frmPHry"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim env As rdoEnvironment
Dim cn As rdoConnection
Dim result As rdoResultset
Dim result1 As rdoResultset
Dim d_conn, sql As String
Dim hrowcount, hrowcount1 As Integer
Private Sub Command1_Click()
Dim itm As ListItem
Dim hrecord As Integer
If Flagh = 1 Then
sql = "insert into worktable(类别,姓名,编号) values('" & Trim(Combo1.Text) & "','" & Trim(Text2.Text) & "','" & Trim(Text3.Text) & "')" '& Trim(Combo1.Text) & "','" & Trim(Text4.Text) & "','" & Trim(Text5.Text) & "','" & Trim(Combo2.Text) & "'," & Val(Trim(Text6.Text)) & "," & Val(Trim(Text7.Text)) & ",'" & Trim(Text8.Text) & "'," & Val(Trim(Text9.Text)) & ",'" & Trim(Text10.Text) & "','" & Trim(Text11.Text) & "'," & Val(Trim(Text12.Text)) & "," & Val(Text13.Text) & ",'" & Trim(Text14.Text) & "')"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
sql = "select * from worktable order by 类别"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
If result.RowCount <> 0 Then
result.MoveLast
hrecord = result.RowCount + 1
result.MoveFirst
End If
frmPHygin.ListView1.ListItems.Clear
If result.RowCount <> 0 Then
Do While Not result.EOF()
Set itm = frmPHygin.ListView1.ListItems.Add(, , result("类别"))
itm.SubItems(1) = Trim(result("姓名"))
itm.SubItems(2) = Trim(result("编号"))
result.MoveNext
Loop
End If
End If
If Flagh = 2 Then
sql = "update worktable set 类别='" & Trim(Combo1.Text) & "',姓名='" & Trim(Text2.Text) & "',编号='" & Trim(Text3.Text) & "' where 类别='" & Trim(listviewtext(2)) & "' and 姓名='" & Trim(listviewtext(0)) & "' and 编号='" & Trim(listviewtext(1)) & "'"
Set result = cn.OpenResultset(sql, rdOpenDynamic, rdConcurRowVer)
End If
'Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
Move Screen.width / 2 - frmPHry.width / 2, Screen.height / 2 - frmPHry.height / 2
Set env = rdoEnvironments(0)
env.CursorDriver = rdUseOdbc
d_conn = "uid=sa;pwd=;driver={SQL SERVER};SERVER=ntserver;database=phdatabase;"
Set cn = env.OpenConnection(dsname:="odbc_api_demo", Prompt:="rdodriverprompt", ReadOnly:=False, Connect:=d_conn)
Combo1.AddItem "业务员"
Combo1.AddItem "签单人"
Combo1.AddItem "设计员"
Combo1.AddItem "操作员"
Combo1.AddItem "欠款审核"
If Flagh = 2 Then
Combo1.Text = listviewtext(2)
Text2.Text = listviewtext(0)
Text3.Text = listviewtext(1)
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -