拜托各位!!!关于登陆界面的问题!
登陆界面验证程序如下
Dim Provider = "Provider=Microsoft.Jet.OLEDB.4.0"
Dim Database = "Data Source=" & Server.MapPath( "Test.mdb" )
Sub Enter_Click(sender As Object, e As EventArgs)
Msg.Text = ""
Dim Conn As OleDbConnection, Cmd As OleDbCommand
Dim Rd As OleDbDataReader, SQL As String
Conn = New OleDbConnection( Provider & ";" & DataBase )
Conn.Open()
SQL = "Select * From name Where 用户名=" & name1.Text & " And 密码=" & password1.Text & ""
Cmd = New OleDbCommand( SQL, Conn )
Rd = Cmd.ExecuteReader()
下面改如何写?我想登陆正确后进入另一个界面。。。
问题点数:100、回复次数:6Top
1 楼houbinbin()回复于 2002-11-29 15:46:35 得分 40
if rd.iseof()
response.write "your name or password is invalid"
else
response.redirect yourpage.aspx
end ifTop
2 楼lzhzxl(云中人)回复于 2002-11-29 15:49:22 得分 20
While (Rd.Read())
Name1 = Rd.GetString(0)
Pass1 = Rd.GetString(1)
If (Pass1 = Mypass) Then
Response.Redirect("main.aspx")
Else
Session("HasLogin") = "False"
Response.Write("<body bgcolor=#ffcc88><p> </p><p valign='middle' align='center'> 出错提示:<font color=#ff0000>用户或密码错误!</font></p>")
End If
end while
Top
3 楼ahya(蜡笔小新)回复于 2002-11-29 15:58:33 得分 0
houbinbin:::::编译器错误信息: BC30456: “iseof”不是“System.Data.OleDb.OleDbDataReader”的成员。Top
4 楼ahya(蜡笔小新)回复于 2002-12-02 15:43:03 得分 0
上边的都不好用呀!拜托大家了!Top
5 楼zat1978(蓟)回复于 2002-12-02 15:45:35 得分 30
if rd.read()
response.write "your name or password is invalid"
else
response.redirect yourpage.aspx
end if
Top
6 楼zat1978(蓟)回复于 2002-12-02 15:46:24 得分 10
说明:read()如果没有数据就返回falseTop




