| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1399 人关注过本帖
标题:请问 asp中怎样显示备注型字段
只看楼主 加入收藏
gaosx0731
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-3-12
收藏
 问题点数:0 回复次数:8 
请问 asp中怎样显示备注型字段

我的代码如下:
<%
id=request.queryString("id")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db1.mdb")
exec="select * from news where id='"&"id&"'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%=rs("content")%></td>
</tr>
</table>
</body>
</html>
但是却会出错 错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E07)
[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配。

搜索更多相关主题的帖子: 字段 备注 asp 
2007-05-20 13:25
zhulei1978
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:53
帖 子:1351
专家分:1200
注 册:2006-12-17
收藏
得分:0 
<%
id=request.queryString("id")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db1.mdb")
exec="select * from news where id='"&"id&"'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<%if not(rs.eof) then%>
<%=rs("content")%>
<%end if%>
</td>
</tr>
</table>
</body>
</html>

其实我就是改变社会风气,提高少女素质,刺激电影市道,提高年轻人内涵,玉树临风,风度翩翩的整蛊专家,我名叫古晶,英文名叫JingKoo!
2007-05-20 14:52
gaosx0731
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-3-12
收藏
得分:0 
楼上的 还是不行 一样的错误
2007-05-20 16:01
无根泉
Rank: 2
等 级:新手上路
威 望:4
帖 子:853
专家分:0
注 册:2004-11-4
收藏
得分:0 
<%
id=request.queryString("id")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db1.mdb")
exec="select * from news where id='"&"id&"'"
'这里可以改成这样
exec="select * from news where id=" & id
'或
exec="select * from news where cstr(id)='"&"id&"'"

set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%=rs("content")%></td>
</tr>
</table>
</body>
</html>

我很菜,但我很努力!
2007-05-20 16:30
lq7350684
Rank: 6Rank: 6
等 级:贵宾
威 望:20
帖 子:5089
专家分:98
注 册:2006-11-6
收藏
得分:0 
exec="select * from news where id='"&"id&"'"
改成
exec="select * from news where id="&id&""
试试
2007-05-20 20:21
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:0 
首先楼主代码里的id是什么类型的字段,数字型?字符型?
2007-05-20 21:41
kidy2005
Rank: 1
等 级:新手上路
帖 子:107
专家分:0
注 册:2007-4-18
收藏
得分:0 
先搞清楚字段的类型啦

恒天装饰网:http://www.
2007-05-22 11:51
guyer
Rank: 2
等 级:新手上路
威 望:5
帖 子:451
专家分:0
注 册:2007-1-19
收藏
得分:0 
<%
id=request.queryString("id")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("db1.mdb")
exec="select * from news where id='"&"id&"'" 你的ID应该是自动排序吧 where id="&id 这样看看
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><%=rs("content")%></td>
</tr>
</table>
</body>
</html>

http://www./
2007-05-22 12:24
狼王太子
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2007-1-27
收藏
得分:0 
exec="select * from news where id="&id&""

2007-05-22 15:19
快速回复:请问 asp中怎样显示备注型字段
数据加载中...
 
   



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

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