Microsoft VBScript 编译器错误 错误 '800a03f6'急

来源:百度知道 编辑:UC知道 时间:2024/06/21 19:58:11
程序是<%
name=request.form("name")
tel=request.form("tel")
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("example3.mdb")
exec="select * from guestbook where name='"+name+"' and tel="+tel
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<head>
<title>无标题文档</title>
<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">
<%
do while not rs.eof
%><tr>
<td><%=rs("name")%></td>
<td><%=rs("tel"

这句代码可能有问题:
exec="select * from guestbook where name='"+name+"' and tel="+tel

tel是一个字符串型的变量,所以你的这句代码这样写才对,你试一下:

exec="select * from guestbook where name='"+name+"' and tel='"+tel +"'"