菜鸟请教大虾一个问题,谢谢了
我现在要做一个登陆验证页,其中以学号为用户名,生日为其初始密码,数据库表名为xsda(内有学号XH与身份证SFZ字段)学号为字符型6位,代码如下(好像有点问题)
<%
Option Explicit
dim rs
dim sql
dim xh,sfz
xh=left(request("user_name"),6)
sfz=left(request("password"),6)
if password="" or xh="" then
response.redirect "error.asp"
end if%>
<!--#include file="conn.asp"-->
<%Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from xsda where xh like '" & xh & "'and sfz like '" & sfz & "'"
rs.open sql,conn,3,2
if rs.eof and rs.bof then
response.redirect "error.asp"
else response.redirect "search.asp?xh=rs("xh")"
end if%>
有两个问题,一是如何分类提取15位和18位身份证号的出生年月,二是代码怎么写比较好,谢谢