您的当前位置:我要购书网>在线阅读>ASP/PHP/.NET/XML

导出lotus用户的方法(用asp技术)

来源:互联网  作者:  发布:我要购物网收集整理  发布时间:2006-8-31 人气:173

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%>条信息!

相关文章
· 导出sqlserver数据到excel中
· 导出lotus用户的方法(用asp技术)
· 导出数据到excel概述
· 导出oracle数据库对象---同义词,系列,视图
热点文章
%>
· creating user controls
· 提高fastreplace速度 (fstrrep.pas)
· asc ii 完整码表及简介
· 自动生成拼音(汉字反查到拼音)
· sql2000无法安装的解决办法
· 浏览器集成教学 自定义浏览器
· vc++技术内幕(第四版)笔记(第7章)
· mysql5.0中文乱码解决方案
· sql server日期计算
· vc下利用ado连接access数据库
 淘宝旺旺:我要购书网上书店『图书目录
本购书中心地址: 杭州市延安路111号清波商厦南楼D座(总部) 上海市闸北区老沪太路网上购书中心(沪部),  邮编:310002
电子邮件:books@51goushu.com  经营许可证编号:沪ICP备06038574号
版权所有 2003-2008 © All Rights Reserved .购书网