| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 421 人关注过本帖
标题:asp +access这个代码同时上传word和提交表单出错该怎么办,求解
只看楼主 加入收藏
海的天空
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2011-4-25
结帖率:100%
收藏
 问题点数:0 回复次数:1 
asp +access这个代码同时上传word和提交表单出错该怎么办,求解
studentfiledata=MyRequest("studentfiledata")

exp_title=MyRequest("exp_title")
exptitle=Rtrim(Ltrim(exp_title))
exptitle=fenci(exptitle)
exp_title=MyRequest("exp_title")

exp_course=MyRequest("exp_course")
expcourse=Rtrim(Ltrim(exp_course))
expcourse=fenci(expcourse)
exp_course=MyRequest("exp_course")

course_number=MyRequest("course_number")
coursenumber=Rtrim(Ltrim(course_number))
course_number=MyRequest("course_number")

exp_introduction=MyRequest("exp_introduction")
expintroduction=Rtrim(Ltrim(exp_introduction))
exp_introduction=MyRequest("exp_introduction")

exp_date=MyRequest("exp_date")
expdate=Rtrim(Ltrim(exp_date))
exp_date=MyRequest("exp_date")

exp_people=MyRequest("exp_people")
exppeople=Rtrim(Ltrim(exp_people))
exp_people=MyRequest("exp_people")

student_number=MyRequest("student_number")
studentnumber=Rtrim(Ltrim(student_number))
student_number=MyRequest("student_number")

student_college=MyRequest("student_college")

student_major=MyRequest("student_major")
studentmajor=Rtrim(Ltrim(student_major))
student_major=MyRequest("student_major")

student_grade=MyRequest("student_grade")

student_class=MyRequest("student_class")


exp_location=MyRequest("exp_location")
explocation=Rtrim(Ltrim(exp_location))
explocation=fenci(explocation)
exp_location=MyRequest("exp_location")

exp_collaborator=MyRequest("exp_collaborator")
expcollaborator=Rtrim(Ltrim(exp_collaborator))
expcollaborator=expcollaborator+" "
exp_collaborator=MyRequest("exp_collaborator")

exp_tutor=MyRequest("exp_tutor")
exptutor=Rtrim(Ltrim(exp_tutor))
exp_tutor=MyRequest("exp_tutor")
filesize = lenb(filedata)
        if  filesize = 0 then
            Msg = Msg & "上传文件:没有<br>"
        else
filename = GetFileName("filedata")
filename=replace(filename," ","")
            ''限制加入的类型 *.asp
file_ctype = GetContentType("filedata")
        end if
    if  UploadSize=true and UploadType=true and exp_title<>"" and student_number<>"" then
    set brs=myconn.execute("select * from baogao where exp_title='"&exptitle&"'")  
    if brs.eof then
    '保存数据到baogao
      path = "files/"
      bsql = "insert into baogao(exp_title,student_number,exp_date,exp_location,exp_collaborator,exp_tutor,path) values ('"&exptitle&"','"&studentnumber&"','"&expdate&"','"&explocation&"','"&expcollaborator&"','"&exptutor&"','"&path&filename&"')"
      'response.write bsql
      'response.end
      myconn.execute(bsql)
      call savetofile(studentfiledata,path,filename)
      
      set crs=myconn.execute("select * from course where exp_title='"&exptitle&"'")  
      if crs.eof then
      '保存数据到course
        csql = "insert into course(exp_title,exp_course,course_number,exp_introduction) values ('"&exptitle&"','"&expcourse&"','"&coursenumber&"','"&expintroduction&"')"
        myconn.execute(csql)
      end if
      
      set ers=myconn.execute("select * from expmessage where exp_title='"&exptitle&"'")  
      if ers.eof then
      '保存数据到course
        esql = "insert into expmessage(exp_title,course_number,student_grade,student_class,exp_location,exp_date,exp_tutor) values ('"&exptitle&"','"&coursenumber&"',''"&student_grade&"','"&student_class&"','"&explocation&"','"&expdate&"','"&exptutor&"')"
        myconn.execute(csql)
      end if
      
      set srs=myconn.execute("select * from student where student_number='"&student_number&"'")  
      if srs.eof then
      '保存数据到student
        ssql = "insert into student(student_number,exp_people,student_college,student_major,student_grade,student_class) values ('"&studentnumber&"','"&exppeople&"','"&student_college&"','"&studentmajor&"','"&student_grade&"','"&student_class&"')"
      
      end if
      myconn.execute(ssql)
            
            if len(filedata)<>0 then
               Call SavetoFile(filedata,basepath,filename)
            end if
        end if

        myconn.close()
        set myconn = nothing
搜索更多相关主题的帖子: access word 
2011-04-26 16:35
dzt0001
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:5
帖 子:1281
专家分:4998
注 册:2005-10-12
收藏
得分:0 
这里用到了一个savetofile类,不知道使用的是什么方法,ASP上传蛮麻烦的代码又多。

----我怎能在别人的苦难面前转过脸去----
2011-04-26 16:44
快速回复:asp +access这个代码同时上传word和提交表单出错该怎么办,求解
数据加载中...
 
   



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

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