<%@ Page Language="vb" Debug=true%>
<%@ import namespace="system.data"%>
<%@ import namespace="system.data.oledb"%>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language="vb" runat="server">
        sub buttonlogin_click(obj as object,e as eventargs)
dim rd as oledbdatareader
dim lrd
dim conn as oledbconnection=nothing
dim connflag as boolean=false
dim connstr,sql as string
connstr= "provider=microsoft.jet.oledb.4.0;data source="&server.mappath("tgTimeSheet.mdb")
conn= new oledbconnection(connstr)
conn.open()
'connflag=grantreadaccesstosysobjects()
sql= "select * from user where name='" & Txtname.text & "'"
dim cmd as oledbcommand= new oledbcommand(sql,conn)
'cmd
'cmd.activeconnection.open()
lrd=cmd.executereader()
rd=lrd
'cmd.execute(rd)
'If rd.EOF And rd.BOF Then
' response.write '对不起,你没有写这天的日记呢,:)'
'else
while rd.read()
       if rd.item("pwd")<>trim(txtpwd.text) then 
      label.text="密码错误!请查证后输入!"
   end if   
end while
rd.close
conn.close
end sub
</script>
</head>
<body bgcolor="#94CBFF">
<form runat="server">
<table width="256" border="1" align="center">
  <tr>
    <td width="67" height="27">用户名:</td>
    <td width="173">
      <asp:TextBox ID="TxtName" ToolTip="请输入密码" TextMode="SingleLine" runat="server" />    
    </td>
  </tr>
  <tr>
    <td height="25">密码:</td>
    <td>
      <asp:TextBox ID="Txtpwd" ToolTip="请输入密码" TextMode="Password" runat="server" />    
    </td>
  </tr>
  <tr>
    <td height="25">&nbsp;</td>
    <td>
      <center><asp:Button ID="Buttonlogin" Text="登录" OnClick="buttonlogin_click" runat="server" /></center>     
      <div align="left"></div></td>
  </tr>
  <tr><td height="23" colspan="2">
    <asp:Label ID="Label" runat="server" />  
  </td>
  </tr>
</table>
</form>
</body>
</html>当运行到lrd=cmd.executereader()时,就会出错如下:
Exception Details: System.Data.OleDb.OleDbException: FROM 子句语法错误。
大家帮帮忙, 这是怎么回事呢,?