为什么这样提取excel表里的数据时,无法提取字符,只能取出数字?????

yangxuhua 2006-08-10 07:59:11
Dim conn
Dim excelPath,connExcelStr
Dim rs
Set conn=Server.CreateObject("ADODB.Connection")
excelPath = server.MapPath("../excls/test.xls")
connExcelStr="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & excelPath & ";Extended Properties=Excel 8.0"
conn.open connExcelStr

Set rs = Server.CreateObject("ADODB.Recordset")
<%
do while not rs.eof
%>
<tr align="center" bgcolor="#66CC66">
<td height="20"><%=rs("name")%></td>
<td height="20"><%=rs("sex")%></td>
<td height="20"><%=rs("age")%></td>
</tr>
<%
rs.movenext
loop


%>
</table>

如果值里有字符,就无法显示。。为什么???
...全文
116 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangxuhua 2006-08-11
  • 打赏
  • 举报
回复
那代码是这样写的:
Sql="select * from [Sheet1$]"
rs.Open Sql,conn,1,1
yangxuhua 2006-08-11
  • 打赏
  • 举报
回复
哦,那句我没贴上去,,
从来没遇到这个问题,显示不出字符,只能取数字..
jacklinchen 2006-08-11
  • 打赏
  • 举报
回复
rs的记录集在哪里生成?
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open ?????

28,391

社区成员

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

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