关于asp连接mysql读取longtext

肥龙上天 肥龙上天 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
链接数据库代码及显示代码如下:

链接数据库代码
<%
Response.Buffer搜索=True
ServerPath="****"
DataPath="***_db"
UserName="h****"
PassWord="*****"
connstr="Driver={MySQL ODBC 5.1 Driver};server="&ServerPath&";uid="&UserName&";pwd="&PassWord&";database="&DataPath&";option=16419;Stmt=Set Names 'GBK';"
SqlNowString="Now()"
SqlChar="'"
ver="5.13a"

On Error Resume Next
Set cn=Server.CreateObject("ADODB.Connection")
cn.open ConnStr
set rs=Server.CreateObject("ADODB.Recordset")

If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
%>
显示代码:
<% sql="select * from qoa where order by title asc"
rs.open sql,cn,3,3
if rs.eof then
response.write"没有记录"
else
%>
<%Do while not rs.eof
%>
<li> <%response.write left (rs("title"),200)& " "%>
<%
rs.movenext
loop

rs.close
set rs=nothing
end if
%>

其中,rs("title")所在字段在数据库中类型为longtext型,此程序在显示rs("title")的位置显示为空白,但将数据库改成varchar 型时,显示正常。但由于该字段存储为大量字符,所以希望使用长字符型。
请指点迷津,谢谢1
...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
肥龙上天
ASP 28,401 成员 356,940 内容