当前位置:首页
开发技术指南» 文章正文
    引言:

 ·imp数据导入问题    »显示摘要«
    摘要: 原环境:win2k +oracle 8.1.5 目标环境 solaris+oracle8.1.5 用imp导入时,到一个表的时候,竟不动了,等待好长时间也没动静。 后来,删除原导入内容,再次导入,提示: imp-00058: oracle 错误12571出现 ora-12571: tns:packet writer failure imp-00021: 操作系统错误 - 错误代码(十进制2......
    摘要: 有时需要一个计算列,该列的数据由别的列的数据计算得出。 如: select field1, field2, field1+field2 from table1 第三列是计算列。 但如果计算列需要从取了别名的列计算得出,就不能直接使用: select .... , sum(count1) "count1", sum(count2) "count2" ,......


关于asp对excel的操作,在线等,进者有分

运行时,错误信息如下  
  错误   80010105    
  服务器出现意外情况。    
   
  /city/lh_b.asp,行105    
  在这个文件中,我先上传文件,然后上传后的excel进行操作,通过读excel表的一列数据,把它插入到SQL表的相应字段中,第一次执行正常,第二次执行就提示上面所说的错误信息。后来我用excel打开上传后的excel文件,竟然提示该文件正处于锁定状态,xx正在编辑,我想问题就是在这里了,而且错误信息中所说的行105的语句是Set   xlbook   =   xlApp.Workbooks.Open(strsource),也就是说打不开excel文件,但是我不知道该怎么修改  
  <%  
   
  FilePath="excel"  
  FileMaxSize=100000  
  FileType=".xls"  
  fileweb="/"  
  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    
     
  dim   upload,file,formName,iCount,team3  
  set   upload=new   upload_5xSoft   建立上传对象  
  if   Pathset   >   0   then       得到上传目录  
    UpFilePath   =   upload.form("pic")  
  else  
    UpFilePath   =   FilePath  
    在目录后加(/)  
    if   right(UpFilePath,1)<>"/"   then   UpFilePath=UpFilePath&"/"    
  end   if  
   
  team3=upload.form("team3")  
  picsm=upload.form("pic")  
  iCount=0  
  for   each   formName   in   upload.file   列出所有上传了的文件  
    set   file=upload.file(formName)     生成一个文件对象  
    if   file.FileSize>0   then                   如果   FileSize   >   0   说明有文件数据  
    if   file.FileSize<FileMaxSize   then   如果未超过文件大小限制  
   
    if   FileType<>""   then 如果限制了上传文件类型  
    if   Instr(FileType,GetExtendName(file.FileName))   then  
  TypeFlag   =   1                 文件为允许的类型  
    else  
  TypeFlag   =   0 文件为不允许的类型  
    response.write   "<script>alert(不支持您所上传的文件类型:"&   GetExtendName(file.FileName)   &")</script>"  
    response.write   "<script>history.back(-1)</script>"  
    response.end  
  end   if  
    else  
    TypeFlag   =   1 没有限制上传文件类型  
     
    end   if  
   
      if   TypeFlag   =   1   then    
  newfilename   =   year(now())&   month(now())&   day(now())&hour(now())&minute(now())&second(now()) 新文件名  
      vfname   =   newfilename  
            if   nameset   =   1   then  
      fname   =   vfname&"."   &   GetExtendName(file.FileName)  
                elseif   nameset   =2   then  
        fname   =   file.FileName  
            elseif   nameset   =   3   then  
    fname   =   vfname   &   file.FileName  
    end   if  
      file.SaveAs   Server.mappath(UpFilePath&fname)       保存文件  
      response.write   file.FilePath&file.FileName&"   ("&file.FileSize&")   =>   上传图片成功!   <br>"  
      iCount=iCount+1  
    fileStr   =   fileStr   &   "<img   src=pic/addon.gif><a   href="&   UpFilePath&file.FileName&"   target=_blank>查看上传的文件:<font   color=red>"   &   file.FileName   &"</font>   ("&   file.FileSize   &"   kb)</a><br>"  
    FileNameStr   =   UpFilePath&fname  
       
  end   if  
   
    else  
    response.write   "<script>alert(文件大小超出限制,您最多可以上传   "&   FileMaxSize   &"个字节的文件数据)</script>"  
    response.write   "<script>history.back(-1)</script>"  
    response.end  
    exit   for  
    end   if  
    end   if  
    set   file=nothing  
  next  
   
  set   upload=nothing     删除此对象  
   
   
  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  
  %>  
  <%   dim   city_code  
  city_code=session("city")  
  Set   xlApp   =   server.CreateObject("Excel.Application")    
  strsource   =Server.mappath(UpFilePath&fname)  
  Set   xlbook   =   xlApp.Workbooks.Open(strsource)    
  Set   xlsheet   =   xlbook.Worksheets(1)    
  i=2  
    dim   s  
  do   while     xlsheet.cells(i,1)<>""  
      s=xlsheet.cells(i,1)  
      i=i+1  
      if   team3=""   then  
    sql="insert   into   mobile_list(mobile,city_code)   values("&s&","&city_code&")"  
      else  
        sql="insert   into   mobile_list(mobile,city_code,team_id)   values("&s&","&city_code&","&team3&")"  
        end   if  
      conn.execute(sql)  
      loop  
  set   xlsheet=nothing    
  set   xlbook=nothing    
  xlApp.Quit  
  Set   xlApp=Nothing  
  conn.close  
  set   conn=nothing    
  response.write   ("<script>alert(""号码分配成功!"");this.location.href=lh.asp;</script>")  
  %>  
   
   
 

NO.1   作者: tigerwen01

应该是权限问题,运行dcomcnfg设置权限。

NO.2   作者: rainxiang

<%      
  ASP读取EXCEL注事项  
  i)将Excel97或Excel2000生成的XLS文件看成一个数据库,其中的每一个工作表(sheet)看成数据库表      
  ii)ADO假设Excel中的第一行为字段名.所以你定义的范围中必须要包括第一行的内容      
  iii)Excel中的行标题不能够包含数字.     Excel的驱动在遇到这种问题时就会出错的。例如你的行标题名为“F1”      
  iiii)如果你的Excel电子表格中某一列同时包含了文本和数字的话,那么Excel的ODBC驱动将不能够正常,     处理这一行的数据类型,你必须要保证该列的数据类型一致      
   
  WIN2000SERVER+IIS5     测式通过      
   
   
   
      Dim     Conn,Driver,DBPath,Rs      
   
          建立Connection对象      
   
      Set     Conn     =     Server.CreateObject("ADODB.Connection")      
   
      Driver     =     "Driver={Microsoft     Excel     Driver     (*.xls)};"      
   
      DBPath     =     "DBQ="     &     Server.MapPath(     "test.xls"     )      
   
      调用Open     方法打开数据库      
   
      Conn.Open     Driver     &     DBPath      
   
      DSN连接方式      
   
      Conn.Open     "Dsn=test"      
   
      注意     表名一定要以下边这种格试     "[表名$]"     书写      
   
      Sql="Select     *     From     [Sheet1$]     where     序号=0"      
   
      Set     Rs=Conn.Execute(Sql)      
   
      IF     Rs.Eof     And     Rs.Bof     Then      
   
          Response.write     "没有找到您需要的数据!!"      
   
      Else      
   
          Do     While     Not     Rs.EOF      
   
              Response.write     Rs("姓名")      
   
          Rs.MoveNext      
   
          Loop      
   
      End     IF      
   
      Rs.Close      
   
      Set     Rs=nothing      
   
      Conn.Close      
   
      Set     Conn=Nothing      
   
      Response.Write         "成功!"      
   
  %>      
   
 

NO.3   作者: ziyantan

百度关键字:Access   to   Excel   子言

NO.4   作者: jamila8

这么复杂,顶一下

NO.5   作者: zhanglemail

学习学习   顶


    摘要: vc6工程直接双击打开时会在同一个窗口中关闭现有的工程,不会另开一个窗口 而.net会重新打开一个窗口,不关闭已经存在的工程, 请问如何让vc6也能像.net那样,否则太麻烦了,我前面的xp系统下装了.net和vc6,不知当时怎么搞的,双击vc6的工程都会在新窗口中打开,前两天格式化了系统以后再装上.net和vc6,怎么弄也不能实现双击vc6的工程就开新窗口打开,郁闷! ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE