看看我的数据库连接问题
ipfind.asp
内容如下
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>IP地址查询</title>
</head>
<body>
<form name="form1" method="post" action="index.asp">
搜索:<br>
姓名:
<input type="text" name="name">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</form>
</table>
</body>
</html>
index.asp
内容如下
<%
name="%"
if request.form("name")<>"" then
name=request.form("name")
end if
ip="%"
if request.form("ip")<>"" then
ip=request.form("ip")
end if
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("ip.mdb")
exec="select * from ip where name='"&name&"' and ip='"&ip&"'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>IP地址查询</title>
</head>
<body>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">IP地址查询</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr align="center" >
<td>单位</td>
<td>姓名</td>
<td>IP地址</td>
<td>MAC地址</td>
</tr>
<%do while not rs.eof%>
<tr align="center">
<td><%=rs("unit")%></td>
<td><%=rs("name")%></td>
<td><%=rs("ip")%></td>
<td><%=rs("mac")%></td>
</tr>
<%
rs.movenext
loop
%>
</table>
</body>
</html>
说我第14行错误 为什么/.?//
内容如下
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>IP地址查询</title>
</head>
<body>
<form name="form1" method="post" action="index.asp">
搜索:<br>
姓名:
<input type="text" name="name">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="Submit2" value="重置">
</form>
</table>
</body>
</html>
index.asp
内容如下
<%
name="%"
if request.form("name")<>"" then
name=request.form("name")
end if
ip="%"
if request.form("ip")<>"" then
ip=request.form("ip")
end if
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("ip.mdb")
exec="select * from ip where name='"&name&"' and ip='"&ip&"'"
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>IP地址查询</title>
</head>
<body>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">IP地址查询</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr align="center" >
<td>单位</td>
<td>姓名</td>
<td>IP地址</td>
<td>MAC地址</td>
</tr>
<%do while not rs.eof%>
<tr align="center">
<td><%=rs("unit")%></td>
<td><%=rs("name")%></td>
<td><%=rs("ip")%></td>
<td><%=rs("mac")%></td>
</tr>
<%
rs.movenext
loop
%>
</table>
</body>
</html>
说我第14行错误 为什么/.?//
...全文
相关推荐
解决Java 连接MySQL数据库的出现的问题
完整解决Java MySQL连接的方法,步骤清晰简明,立即解决
C#连接Informix数据库的问题
主要介绍了C#连接Informix数据库的问题,本文给大家介绍的非常详细,对大家的工作或学习具有一定的参考借鉴价值,需要的朋友可以参考下
PB9.0升级到11.5 后数据库连接问题
由于pb9.0对webservice支持不好,因此将程序升级到pb11.5下面是本人在升级过程中的一些体会,希望对大家有用
解决Django连接db遇到的问题
1、django.db.utils.ConnectionDoesNotExist: The connection default doesn’t exist 解决:第一个连接的命名一定要是default,将EN5Test改为default即可 2、django.core.exceptions.ImproperlyConfigured Requested setting DATABASES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODUL
dr中数据库连接问题
解决dreameaver中数据库连接中字符串定义连接问题。。。。03版和10版office的不同


