免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2277 | 回复: 1
打印 上一主题 下一主题

[Lotus] [源码系列]从关系数据库中提取数据 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-05-23 00:29 |只看该作者 |倒序浏览
//*******************************************************************************
// Written by  Fan   [源码系列]从关系数据库中提取数据
// APP: http://item.taobao.com/auction/i ... m_num_id=5105121621
// Lotus_OA_源码交流QQ群:58879202
//********************************************************************************
''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Initialize
        On Error Goto ErrorRoutine       
        Set s = New notessession
        Set db=s.currentdatabase
       
        sdbfile=getDBPath(getdbpathfile)+"system.nsf"
        Set sdb = New notesdatabase(db.server,sdbfile)
        Set profile=sdb.GetProfileDocument("AdminForm")
        Set view = sdb.getview("employee")
        If profile Is Nothing Then
                Messagebox "没有设置配置库简要表文档!",MB_OK+64,"提示"
                Exit Sub
        Else       
               
                DataSource=profile.dataSource(0)
                UserName=profile.username(0)
                Password=profile.password(0)
        End If
        '''''''''''''''''
        Dim con As New ODBCConnection
        con.SilentMode = True
        If Not con.ConnectTo(DataSource,UserName,Password) Then
                Messagebox "不能连到指定的数据源"
                Exit Sub
        End If
       
        Dim qry As New ODBCQuery
        Dim result As New ODBCResultSet
        Set qry.Connection = con
        Set result.Query = qry
        'qry.SQL = "SELECT * FROM  "+table
        qry.SQL = "SELECT * FROM  jq_kqview2"
        'Msgbox qry.sql
        'Exit Sub
        result.Execute
        If result.IsResultSetAvailable Then
                'while循环测试用
                'While i<=10                 
                Do
                        bm = result.GetValue("d_bm")
                        bygx = result.GetValue("d_bygx")
                        byjr = result.getvalue("d_byjr")
                        byzr = result.getvalue("d_byzr")
                        byps = result.getvalue("d_byps")
                        bybsj = result.getvalue("d_bybsj")
                        'Msgbox bm
                        'Msgbox bygx
                        'Exit Sub
               '修改个人文档中假期信息                         
                        Call updatedoc
                        result.NextRow
                Loop Until result.IsEndOfData
                'Wend                       
                result.Close(DB_CLOSE)
        Else
                Print "没有查询到任何jq_kqview2中的数据!!"
                con.disconnect
                Exit Sub
        End If
       
        con.Disconnect
       
        Exit Sub
ErrorRoutine:
        Messagebox "错误:" & Str(Err) & ": " & Error$
        Exit Sub
End Sub

看贴要顶,也是一种美德..

论坛徽章:
0
2 [报告]
发表于 2010-05-28 12:17 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP