中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档 | 网通镜像
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > Web开发 > Asp > 综合文章
导出lotus用户的方法(用asp技术)
作者:未知 时间:2004-09-14 12:12 出处:Blog 责编:chinaitpower
              摘要:暂无

lotus用户信息如何导到access中呢。我这里有一个方法,就是先将用户信息引出到文本文件,然后用下面程序输出到access文件中。

<%
'本程序用于将从OA中导出的 用户信息中的一些信息分析出来,并存入数据库中。
'注意1:到出来的文件需要拷贝复制到另一个文本文件中。否则得不到正确结果。
'注意2:如果用户的该项信息不存在则返回 "null" 字符串。
'2004年8月 刘金才
set fso=server.createobject("scripting.filesystemobject")
cFN=server.mappath("tttt.txt")
set fff=fso.getfile(cFN)
set mmm=fff.openastextstream(1)
if not mmm.atendofstream then
    cout=mmm.readall  
end if


Set db=Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("oamail.mdb")
constr="driver={Microsoft Access Driver (*.mdb)};dbq="& DBPath
db.Open constr
db.Execute "delete from oamail"
set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from oamail where id is null",db,3,2


uuu=split(cout, "$Revisions:")
hhh=0
set mmm=nothing
set fff=nothing
set fso=nothing

for i=0 to ubound(uuu)
    wangrui=uuu(i)
    xm=getAinfo(wangrui,"LastName:  ",vbcr)
    un=getAinfo(wangrui,"ShortName:  ",vbcr)
    dw1=getAinfo(wangrui,"FullName:  ",vbcr)  
    dw=getAinfo(dw1,"OU=","/O")
    if xm<>"null" and un<>"null" and dw<>"null" then
      rs.AddNew
      rs("xm")=xm
      rs("un")=un
      rs("dw")=dw
      hhh=hhh+1
    end if 
next

rs.Update
rs.Close
db.Close
set rs=nothing
set db=nothing

 

'从一个字符串中截取一个子串
'sString:要被截的子串
'fStr   :子串开头的标志串(不被包含在子串中)
'eStr   :子串结束的标志串(不被包含在子串中)
function getAinfo(sString,fStr,eStr)
       tmpStr="null"
    ln1=instr(1,sString,fStr)
    if ln1>0 then
          ln2=instr(ln1+len(fStr),sString,eStr)
          if ln2>0 then
                 tmpStr= mid(sString,ln1+len(fStr),ln2-ln1-len(fStr))
          end if
    end if
    getAinfo=tmpStr          
end function


%>
操作结束! ,共截取到<%=hhh%>条信息!

关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有