在Lotus開發(fā)中使用ODBC進行數(shù)據(jù)交互
Sub Initialize Dim session As New NotesSession Dim doc As NotesDocument '當前文檔的后臺文檔 Dim tobeSearchDb As NotesDatabase '待搜索的數(shù)據(jù)庫 Dim DstDocs As NotesDocumentCollection '搜索結(jié)果集 Dim RstDoc As NotesDocument '查詢到的文檔 Dim sRstView As NotesView '結(jié)果顯示視圖 Set Db=Session.CurrentDatabase Set doc=session.DocumentContext Dim con As ODBCConnection Dim userName As String Dim password As String Dim qry As ODBCQuery Dim result As ODBCResultSet Dim A As String Set con = New ODBCConnection Set qry = New ODBCQuery Set result = New ODBCResultSet Set qry.Connection = con Set result.Query = qry A=con.ConnectTo("CoprYW","sa","123") qry.SQL = " INSERT INTO mt(phone,msg_content,sm_flag) VALUES ('"+doc.SMSendTo(0)+"','"+doc.SMBody(0)+"','1'); " 'Call JSAction("Alert",Cstr(a)) If Not result.Execute Then 'Messagebox _ 'result.GetExtendedErrorMessage,, result.GetErrorMessage 'Exit Sub End If result.Close(DB_CLOSE) con.Disconnect End Subposted on 2010-04-09 09:32 明高 閱讀(284) 評論(0) 編輯 收藏 所屬分類: Lotus