急!求助 asp中使用ado读取access数据库中德ole对象类型字段

smkl 2018-09-13 04:52:53
需求 需要存储html
html 从word中复制表格出来到ueditor编辑器(此时ueditor编辑器将它变成了html)
发送 application/x-www-form-urlencoded格式用post方法发送
html的数据大于 备注 类型的64k
百度 无奈只好用Ole
不会 从asp中操作ole
百度 看到csdn的帖子
参考(复制)帖子里的东西写出来没用

asp要做的是接受post发送过来的html并把它存到ole类型的字段中

上面是传过来的表单
代码如下

<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
function TextToBinary(text)
dim bindata,stream
set stream=server.CreateObject("adodb.stream")
with stream
.Type=2'返回值text字符串模式
.Mode=3'readwrite模式
.Open'打开流
.Charset="gb2312"'设置编码为gb2312
.Position=0'设置流初始位置为0
.WriteText text'写入字符串内容
.Position=0'重新设置流位置为0,要不流位置处于最后,读不到数据
.Type=1'设置流返回值类型为2进制
bindata= .read'读取前面写入的字符串对应的2进制流数据
.Close'关闭流
end with
TextToBinary=bindata
end function



Set conn = Server.CreateObject("ADODB.Connection")
connstr = "driver={Microsoft Access Driver (*.mdb)};pwd=admin;dbq=" & Server.MapPath("/") &"\\data\\TP000023.mdb"
conn.open connstr
set rec= server.createobject("ADODB.recordset")
strsql="select * from sd_model_photo where photoid = (select max(photoid) from sd_model_photo)"
rec.open strsql,conn,1,3
rec("xhsm").AppendChunk TextToBinary(request.form("xhsm"))
rec("xncs").AppendChunk TextToBinary(request.form("xncs"))
rec.update
rec.close
set rec = nothing
set conn = nothing
%>

参考帖子
https://bbs.csdn.net/topics/123892
https://bbs.csdn.net/topics/70063393
...全文
717 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
QQ:2776478814,加我,这些我有做过
smkl 2018-09-13
  • 打赏
  • 举报
回复
大活人在哪里

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧