在Lotus开发中使用ODBC进行数据交互

Sub Initialize  Dim session As New NotesSession  Dim doc As NotesDocument     '当前文档的后台文档  Dim tobeSearchDb As NotesDatabase   '待搜索的数据库  Dim DstDocs As NotesDocumentCollection  '搜索结果集  Dim RstDoc As NotesDocument                '查询到的文档  Dim sRstView As NotesView                    '结果显示视图  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 Sub

posted on 2010-04-09 09:32 明高 阅读(267) 评论(0)  编辑  收藏 所属分类: Lotus


只有注册用户登录后才能发表评论。


网站导航:
 
<2010年4月>
28293031123
45678910
11121314151617
18192021222324
2526272829301
2345678

导航

统计

常用链接

留言簿

随笔分类

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜