我做的一个登录事件,但是报错说我是这个错误,看下图:
Dim StrCnn, StrSql As String
Dim Cnn As Data.OleDb.OleDbConnection
Dim cmd As Data.OleDb.OleDbCommand
Dim dr As Data.OleDb.OleDbDataReader
'连接数据库
StrCnn = "Provider=Microsoft.Jet.Oledb.4.0;Data Source=" + Server.MapPath("bbs.mdb")
StrSql = "Select * from UserSheet where LoginName='" + Login1.UserName + "'and UserPass='" + Login1.Password + "'"
Cnn = New Data.OleDb.OleDbConnection(StrCnn)
Cnn.Open()
cmd = New Data.OleDb.OleDbCommand(StrSql, Cnn)
dr = cmd.ExecuteReader()
If (dr.Read()) Then
'存在此用户,将用户名存储为Session变量,然后进入论坛主页
Session("User") = Login1.UserName
Response.Redirect(Login1.DestinationPageUrl)
Else
MsgBox("用户名或密码错误!")
End If
关于登录问题