土
土拨鼠
Unregistered / Unconfirmed
GUEST, unregistred user!
最近在学习Asp编程
连接程序如下
dim conn
set conn=server.createobject("ADODB.CONNECTION")
conn.open "driver={SQL Server};server=(local);uid=long;pwd=long;database=addr"
在另一页面程序为
<!--#include file="db.asp"-->
<%
。。。。。。
Set rs=Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM addressbook "
if Session("searchname")<>"" then
if Session("searchname")<>"reset" then
sql=sql &
" where 姓名 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 部门 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 职务 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 住址 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 邮件地址 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 办公电话 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 家庭电话 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 手机号码 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 传呼机号码 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 备注 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
else
Session("searchname")=null
end if
end if
sql = sql &
" ORDER by " &
ordername
rs.open sql,conn,1,1
alls=rs.Recordcount
。。。。。。。。
单在打开网页时说在 rs.open sql,conn,1,1
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E09)
/tmp/addr.asp, 第 95 行 (就是上面所在行)
请那位高手指点迷津,谢谢
连接程序如下
dim conn
set conn=server.createobject("ADODB.CONNECTION")
conn.open "driver={SQL Server};server=(local);uid=long;pwd=long;database=addr"
在另一页面程序为
<!--#include file="db.asp"-->
<%
。。。。。。
Set rs=Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM addressbook "
if Session("searchname")<>"" then
if Session("searchname")<>"reset" then
sql=sql &
" where 姓名 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 部门 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 职务 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 住址 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 邮件地址 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 办公电话 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 家庭电话 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 手机号码 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 传呼机号码 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
sql=sql &
" or "
sql=sql &
" 备注 LIKE "
sql=sql &
"'%"
sql=sql &
Session("searchname")
sql=sql &
"%'"
else
Session("searchname")=null
end if
end if
sql = sql &
" ORDER by " &
ordername
rs.open sql,conn,1,1
alls=rs.Recordcount
。。。。。。。。
单在打开网页时说在 rs.open sql,conn,1,1
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E09)
/tmp/addr.asp, 第 95 行 (就是上面所在行)
请那位高手指点迷津,谢谢