| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 954 人关注过本帖
标题:[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配
只看楼主 加入收藏
zacom
Rank: 2
等 级:论坛游民
威 望:2
帖 子:381
专家分:15
注 册:2007-9-15
结帖率:88.89%
收藏
 问题点数:0 回复次数:3 
[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹配
问题如上:代码在下:
<%
cont="driver={microsoft access driver (*.mdb)};dbq= " & server.mappath("login.mdb")
set con=server.createobject("adodb.connection")
con.open cont
set rs=server.createobject("adodb.recordset")
action=trim(request("action"))
username=trim(request("username"))
password=trim(request("password"))
if action="action" then check=true
if len(username)<1 then check=false
if len(password)<1 then check=false
if check then
   query="select password from guest where admin="
   query=query&username&""
   rs.open query,con
   if(not rs.eof) then
      if(rs("password")=password) then
             check=true
      else
             check=false
      end if
   else
     check=false
   end if
   if check  then
     response.wirte "登陆成功"
   else
     response.write "登陆失败"
   end if
else
%>
  <html>
  <head>
  </head>
  <body>
  <body>
  <form action="1.asp" method="post">
  <input type="hidden" name="action" value="action">
  <table width="200" border="1">
  <tr>
    <th width="65" scope="row">用户名:</th>
    <td colspan="2"><label>
      <input name="username" type="text" size="5">
    </label></td>
  </tr>
  <tr>
    <th scope="row">登陆:</th>
    <td colspan="2"><label>
      <input name="password" type="text" size="5">
    </label></td>
  </tr>
  <tr>
    <th scope="row"><label>
      <input type="submit" name="Submit" value="登陆">
    </label></th>
    <td width="53"><label>
      <input type="submit" name="Submit2" value="取消">
    </label></td>
    <td width="60"><label>
      <input type="submit" name="Submit3" value="注册">
    </label></td>
  </tr>
  </table>
  </body>
  </html>
<% end if%>
其中admin,password是文本
搜索更多相关主题的帖子: Microsoft quot ODBC Driver Access 
2008-05-04 22:58
永夜的极光
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:2721
专家分:1
注 册:2007-10-9
收藏
得分:0 
rs.open query,con
改成
rs.open query,con,1,1

从BFS(Breadth First Study)到DFS(Depth First Study)
2008-05-05 09:28
makebest
Rank: 8Rank: 8
等 级:蝙蝠侠
威 望:3
帖 子:658
专家分:962
注 册:2005-3-17
收藏
得分:0 
大概是这里出了问题,
   query="select password from guest where admin="
   query=query&"'"&username&"'"
2008-05-05 10:27
zacom
Rank: 2
等 级:论坛游民
威 望:2
帖 子:381
专家分:15
注 册:2007-9-15
收藏
得分:0 
解决了...

没有最好只有更好
2008-05-05 16:52
快速回复:[Microsoft][ODBC Microsoft Access Driver] 标准表达式中数据类型不匹 ...
数据加载中...
 
   



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

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