Option Public
Option Declare
Uselsx "*LSXODBC"
Use "AgnesLibrary"
Use "SP.wfLibV2"
Sub Initialize
'//點選"待通知客戶"按鍵時,將處理時間拋給CiMES
'//for sql statement (在動作中call agent)
On Error Goto errorhandler
Dim session As New NotesSession
Dim agent As NotesAgent
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim conn As New ODBCConnection
Dim query As New ODBCQuery
Dim rs As New ODBCResultSet
Dim strSQL As String
Dim i As Integer, DataSourceNm As String
Set agent = session.CurrentAgent
Set db = session.CurrentDatabase
Print "run- " + agent.Name + " Start..." + Now()
'//connection
Conn.SilentMode=True
Set Query.connection = conn
Set rs.Query = Query
DataSourceNm = "runcard_ws"
If Not ODBC_Connect(Conn, DataSourceNm) Then Call Conn.disconnect : Error 997, "Can't Connect to ODBC (" + DataSourceNm + " )!!"
Set doc = db.GetDocumentByID (agent.ParameterDocID )
If Not doc Is Nothing Then
End If
Call rs.Close(Db_Close)
Call Conn.Disconnect
Print "run- " + agent.Name + " end..." + Now()
TheEnd:
Call rs.Close(Db_Close)
Call Conn.disconnect
Print "run SP_DataTrans_DB1 end...." + Now()
Exit Function
ErrorHandler:
Print "ag: A4. TransToCiMES: SP_ClickRelease() error line = " + Cstr(Erl) + ", error = " + Error$
Resume TheEnd
End Sub
沒有留言:
張貼留言