标题:Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21' (请高手帮 ...
只看楼主
whediann
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2009-8-5
 问题点数:0 回复次数:3 
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21' (请高手帮帮)
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e21'  

多步 OLE DB 操作产生错误。如果可能,请检查每个 OLE DB 状态值。没有工作被完成。  

/sendfileok.asp,行 167  

下面是 sendfileok.asp的 代码
 
 


<!--#include file="asp/opendb.asp"-->
<!--#include file="asp/sqlstr.asp"-->
<!--#include file="asp/checked.asp"-->
<!--#include FILE="upload_5xsoft.inc"-->
<%
oabusyname=request.cookies("oabusyname")
oabusyusername=request.cookies("oabusyusername")
oabusyuserdept=request.cookies("oabusyuserdept")
oabusyuserlevel=request.cookies("oabusyuserlevel")
filepath="file/"
FileMaxSize="2500000"
fileweb="1"
nameset ="1"
pathset ="0"

function makefilename(fname)
  fname = now()
  fname = replace(fname,"-","")
  fname = replace(fname," ","")
  fname = replace(fname,":","")
  fname = replace(fname,"PM","")
  fname = replace(fname,"AM","")
  fname = replace(fname,"上午","")
  fname = replace(fname,"下午","")
  makefilename=fname
end function
%>

<html>
<head>
<title>公文发送成功</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../css/css.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
dim upload,file,formName,iCount
Dim FixFileExt
    Dim intfnN
    Dim FileExtName
    Dim FixFnN
    Dim intFix
    i=0
set upload=new upload_5xSoft ''建立上传对象
FixFileExt="asp|aspx|asa|asax|ascx|ashx|asmx|axd|cdx|cer|config|cs|csproj|licx|rem|resx|shtml|shtm|soap|stm|vb|vbproj|webinfo|cgi|pl|php|phtml|php3|prg|spx|htm|html"        '限制为只有这些文件可以上传(用"|"号格开)
iCount=0
for each formName in upload.file
 set file=upload.file(formName)  
 if file.FileSize>0 then        
 if file.FileSize<FileMaxSize then
FixFnN = Split(FixFileExt,"|")
intFix = Ubound(FixFnN)
            for i = 0 to intFix
                if GetExtendName(file.FileName) = lcase(trim(FixFnN(i))) then
      Response.write "不支持您所上传的文件类型:"
    Response.write GetExtendName(file.FileName)
    Response.write "<br>"
i=1
 exit for
 end if
next
if i=1 then
      Response.write "附件传送失败!!"
 exit for
 end if
 TypeFlag = 1
 
  if TypeFlag = 1 then
  vfname = makefilename(now())
     if nameset = 1 then
  fname = vfname & iCount & "." & GetExtendName(file.FileName)
       elseif nameset =2 then
       fname = file.FileName
         elseif nameset = 3 then
         fname = vfname & iCount & file.FileName
         end if
        
    Upfilepath= "file/"    
  'response.write Upfilepath
  'response.write Server.mappath(UpFilePath&fname)
  file.SaveAs Server.mappath(UpFilePath&fname)  
  'response.write file.FilePath&file.FileName&" ("&file.FileSize&") => 上传附件成功! <br>"
  iCount=iCount+1
  FileNameStr = UpFilePath&fname
  
  if linkpath = "" then
  linkpath = fname
  else
  linkpath = linkpath & "," & fname
  end if

end if

 else
 response.write "单个附件大小超出限制,您最多可以上传 "& FileMaxSize &"个字节的文件数据"
 exit for
 end if
 end if
 set file=nothing
 
next

sub HtmEnd(Msg)
 set upload=nothing
end sub


function GetExtendName(FileName)
dim ExtName
ExtName = LCase(FileName)
ExtName = right(ExtName,3)
ExtName = right(ExtName,3-Instr(ExtName,"."))
GetExtendName = ExtName
end function
%>
<%
title=upload.form("title")
classify=upload.form("classify")
documenttype=upload.form("lb")
content=upload.form("content")
secretRB=upload.form("secretRB")
Degree=upload.form("Degree")
sendto=upload.form("sendto")

dim mysendto
mysendto=split(sendto,"|",-1,1)
for each sendtoinf in mysendto
userdeptpoint=InStr(sendtoinf,":")
if userdeptpoint>0 then
sendtoinflen=len(sendtoinf)
recipientusername=right(sendtoinf,sendtoinflen-userdeptpoint)
if recipientusername="所有人" then
recipientusername="所有人"
else
usernamepoint=Instr(recipientusername,"(")
usernamelen=len(recipientusername)
recipientusername=left(recipientusername,usernamelen-1)
recipientusername=right(recipientusername,usernamelen-1-usernamepoint)
end if
recipientuserdept=left(sendtoinf,userdeptpoint-1)
if oabusyusername="" then
oabusyusername="外部"
end if
if oabusyuserdept="" then
oabusyuserdept="外部公文"
end if
if recipientuserdept="" then
recipientuserdept="外部公文"
end if
if recipientusername="" then
recipientusername="内部"
end if

set conn=opendb("oabusy","conn","accessdsn")
set rs=server.createobject("ADODB.recordset")
sql = "select * from senddate"
rs.Open sql,conn,1,3
rs.addnew
rs("title")=title
Rs("documenttype")=documenttype
Rs("content")=content
rs("sender")=oabusyusername
rs("recipientusername")=recipientusername
rs("recipientuserdept")=recipientuserdept
rs("inputdate")=date
rs("filename")=linkpath
rs.update
rs.close
set rs=nothing
set conn=nothing
end if
next

set upload=nothing  

%>
<table width="95%" height="27" align="center">
  <tr>
    <td width="228" height="23">
      <div align=left><b>公文发送</b> </div>
    </td>
  </tr>
  <tr>
    <td width="228" height="23">
      <p>&nbsp;</p>
      <p>&nbsp;</p>
      <%
      if iCount>0 then
      %>
            <p align="center"><font color="#FF0000">公文发送成功!</font>
      <%
    response.write "<br>成功地上传了"&iCount&" 个附件!"
      %></p>
      <%
      else
    response.write "<br>上传0个附件!"
    end if
      %>
    </td>
  </tr>
</table>
</body>
</html>

[[it] 本帖最后由 whediann 于 2009-8-5 14:32 编辑 [/it]]
搜索更多相关主题的帖子: Microsoft OLE Provider for 
2009-08-05 14:30
whediann
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2009-8-5
得分:0 
我改大了 还是不行
2009-08-05 18:46
whediann
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2009-8-5
得分:0 
yms123 有QQ吗? 可以说下吗?  我加您
2009-08-05 18:47



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-281646-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.024088 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved