主题:各位大侠帮帮小弟看看这个程序……
VB code
' rs.Open "exec add_employee @e_find_id='" & txtPerson(0).Text & "',@e_id='" & txtPerson(0).Text & "',@e_name='" & txtPerson(1).Text & "',@e_sex='" & txtPerson(2).Text & "',@e_birth='" & txtPerson(3).Text & "',@e_dept='" & txtPerson(4).Text & "',@e_duty='" & txtPerson(5).Text & "',@e_study='" & txtPerson(6).Text & "',@e_gov='" & txtPerson(7).Text & "',@e_phone='" & txtPerson(8).Text & "',@e_memo='" & txtPerson(9).Text & "'", con, 1, 3 就是想问这一条的前面exec 和add 是怎么意思呢保存时提示错误 提示未找到存储过程 "add_employee" 数据库中名为tboa_employee
VB code
Private Sub cmdEsave_Click()
For i = 0 To txtPerson.Count - 2
If txtPerson(i).Text = "" Then MsgBox "除备注信息可以为空,其于均不能为空!", vbInformation: Exit Sub
Next i
If Me.cmdEadd.Tag = "添加" Then
Set con = New ADODB.Connection
con.Open PublicStr
Set rs1 = New ADODB.Recordset
rs1.Open "exec add_employee @e_id='" & txtPerson(0).Text & "',@e_name='" & txtPerson(1).Text & "',@e_sex='" & txtPerson(2).Text & "',@e_birth='" & txtPerson(3).Text & "',@e_dept='" & txtPerson(4).Text & "',@e_duty='" & txtPerson(5).Text & "',@e_study='" & txtPerson(6).Text & "',@e_gov='" & txtPerson(7).Text & "',@e_phone='" & txtPerson(8).Text & "',@e_memo='" & txtPerson(9).Text & "'", con, 1, 3
con.Close
MsgBox "数据添加成功!"
Me.cmdEadd.Tag = ""
End If
If Me.cmdEupdate.Tag = "修改" Then
Set con = New ADODB.Connection
con.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_OA"
Set rs = New ADODB.Recordset
rs.Open "exec update_employee @e_find_id='" & txtPerson(0).Text & "',@e_id='" & txtPerson(0).Text & "',@e_name='" & txtPerson(1).Text & "',@e_sex='" & txtPerson(2).Text & "',@e_birth='" & txtPerson(3).Text & "',@e_dept='" & txtPerson(4).Text & "',@e_duty='" & txtPerson(5).Text & "',@e_study='" & txtPerson(6).Text & "',@e_gov='" & txtPerson(7).Text & "',@e_phone='" & txtPerson(8).Text & "',@e_memo='" & txtPerson(9).Text & "'", con, 1, 3
con.Close
MsgBox "数据更改成功!"
Me.cmdEupdate.Tag = ""
End If
adoEmployee.Refresh
' rs.Open "exec add_employee @e_find_id='" & txtPerson(0).Text & "',@e_id='" & txtPerson(0).Text & "',@e_name='" & txtPerson(1).Text & "',@e_sex='" & txtPerson(2).Text & "',@e_birth='" & txtPerson(3).Text & "',@e_dept='" & txtPerson(4).Text & "',@e_duty='" & txtPerson(5).Text & "',@e_study='" & txtPerson(6).Text & "',@e_gov='" & txtPerson(7).Text & "',@e_phone='" & txtPerson(8).Text & "',@e_memo='" & txtPerson(9).Text & "'", con, 1, 3 就是想问这一条的前面exec 和add 是怎么意思呢保存时提示错误 提示未找到存储过程 "add_employee" 数据库中名为tboa_employee
VB code
Private Sub cmdEsave_Click()
For i = 0 To txtPerson.Count - 2
If txtPerson(i).Text = "" Then MsgBox "除备注信息可以为空,其于均不能为空!", vbInformation: Exit Sub
Next i
If Me.cmdEadd.Tag = "添加" Then
Set con = New ADODB.Connection
con.Open PublicStr
Set rs1 = New ADODB.Recordset
rs1.Open "exec add_employee @e_id='" & txtPerson(0).Text & "',@e_name='" & txtPerson(1).Text & "',@e_sex='" & txtPerson(2).Text & "',@e_birth='" & txtPerson(3).Text & "',@e_dept='" & txtPerson(4).Text & "',@e_duty='" & txtPerson(5).Text & "',@e_study='" & txtPerson(6).Text & "',@e_gov='" & txtPerson(7).Text & "',@e_phone='" & txtPerson(8).Text & "',@e_memo='" & txtPerson(9).Text & "'", con, 1, 3
con.Close
MsgBox "数据添加成功!"
Me.cmdEadd.Tag = ""
End If
If Me.cmdEupdate.Tag = "修改" Then
Set con = New ADODB.Connection
con.Open "Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=db_OA"
Set rs = New ADODB.Recordset
rs.Open "exec update_employee @e_find_id='" & txtPerson(0).Text & "',@e_id='" & txtPerson(0).Text & "',@e_name='" & txtPerson(1).Text & "',@e_sex='" & txtPerson(2).Text & "',@e_birth='" & txtPerson(3).Text & "',@e_dept='" & txtPerson(4).Text & "',@e_duty='" & txtPerson(5).Text & "',@e_study='" & txtPerson(6).Text & "',@e_gov='" & txtPerson(7).Text & "',@e_phone='" & txtPerson(8).Text & "',@e_memo='" & txtPerson(9).Text & "'", con, 1, 3
con.Close
MsgBox "数据更改成功!"
Me.cmdEupdate.Tag = ""
End If
adoEmployee.Refresh