readword.asp

来自「办公软件之间的数据交换,可以把WORD文件和EXCEL文件中的数据添加到WEB服」· ASP 代码 · 共 61 行

ASP
61
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
   <%
  ffname1=request.form("ffname")
   filepath="up\updown\"&ffname1
 ' response.write filepath
  
  
    set newconn=server.createobject("adodb.connection")
	set rs=server.createobject("adodb.recordset")
	DBPath = Server.MapPath("#ctm wish.mdb")
	newconn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
	sqlcmd="select * from student_info "
	rs.Open sqlcmd,newconn,1,2
	
   Dim fso,fso1, MyFile,myfile1
   Set fso = CreateObject("Scripting.FileSystemObject")
   'Set MyFile = fso.openTextFile(server.MapPath(filepath), 1,false)
   Set MyFile = fso.openTextFile(server.MapPath(filepath), 1,false)

    public namearray
  do while not myfile.atendofstream
 	   aa=myfile.readline  
          response.write  aa    
       hname=replace(aa,"    "," ")    '用一个空格替换四个空格
       hname=replace(hname,"  "," ")   '用一个空格替换三个空格
       hname=replace(hname,"  "," ")   '用一个空格替换二个空格
      
        response.write pname
        response.write "<br>"
       namearray=split(hname," ")
        max=ubound(namearray)
     
                 rs.addnew
		 rs(1)=namearray(0)
		 rs(2)=namearray(1)
		 rs(3)=namearray(2)
		 rs(4)=namearray(3)
		 rs(5)=namearray(4)
		 rs(6)=namearray(5)
		 rs.update

   


loop

response.Redirect("11.asp")

   %>

</head>

<body>
<a href="index.asp">返回主页</a>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?