Dim s As New NotesSession Dim db As NotesDatabase Dim curdoc As NotesDocument Set db=s.currentdatabase Set curdoc=s.documentcontext Dim poststr As String Dim prokey As Variant poststr=curdoc.Request_content(0) prokey=Split(poststr,";") Dim conndb As NotesDatabase Dim conndoc As NotesDocument Dim connview As NotesView Set conndb=s.Getdatabase("", "Application/AttendanceManage.nsf") If Not conndb.Isopen Then Call conndb.Open("", "") End If Set connview=conndb.Getview("SQLconnSetView") Set conndoc=connview.Getfirstdocument() Const adStateOpen = 1 Dim rs,com As Variant Dim resultstr As String On Error GoTo err_handle ConStr = "Provider = SQLOLEDB.1;Persist Security Info = true;Data Source ='" & conndoc.StServerIP(0) & "'"_ + ";User Id ='" & conndoc.StUserName(0) & "';Password ='" & conndoc.StUserPassword(0) & "'"_ + ";Connect TimeOut = 10;Initial Catalog ='" & conndoc.StDatabaseName(0) & "';" Set Conn = CreateObject("ADODB.Connection") Conn.Open ConStr Set rs = CreateObject("ADODB.recordset") Set Com = CreateObject("ADODB.Command") Set Com.ActiveConnection = Conn Com.CommandType =4 Com.CommandText = "GetKQForUserDate" '存储过程名 Call Com.CreateParameter("@EmployeeID",2,1) Call Com.CreateParameter("@Date",133,1) Com.Parameters("@EmployeeID").value =prokey(0) Com.Parameters("@Date").value = prokey(1) Set rs =Com.Execute resultstr="^^" If rs.eof=false Then resultstr=resultstr + rs.fields(1).value resultstr=resultstr + "^^" + rs.fields(2).value + "^^" Print "<SCRIPT language = javascript>" Print resultstr Print "</SCRIPT>" Else Print "Content-Type:text/html;charset=gb2312" Print "no" End If rs.close Set rs = Nothing Conn.Close Set Conn = Nothing Exit Sub err_handle: If Not rs Is Nothing Then If rs.State = adStateOpen Then rs.Close End If Set rs = Nothing If Not Conn Is Nothing Then If Conn.State = adStateOpen Then Conn.Close End If Set Conn = Nothing MsgBox "签卡申请代理:ReadPersonalAttendance,读取个人考勤错误行:" & Erl() & ",错误描述:" & Error$ Exit Sub End Sub