○ソースは、以下のとおりです。 Private Sub butOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles butOK.Click Dim DBConn As OleDbConnection Dim DBCommand As OleDbDataAdapter Dim DSLogin As New DataSet DBConn = New OleDbConnection("PROVIDER=" _ & "Microsoft.Jet.OLEDB.4.0;" _ & "DATA SOURCE=" _ & Server.MapPath("UserData/LogIn.mdb")) DBCommand = New OleDbDataAdapter _ ("Select UserID from " _ & "Users Where " _ & "UserName = '" & txtUserName.Text _ & "' and Password = '" & txtPassword.Text _ & "'", DBConn) DBCommand.Fill(DSLogin, _ "UserInfo") If DSLogin.Tables("UserInfo"). _ Rows.Count = 0 Then lblMessage.Text = "ユーザー名とパスワードが見当たりません。" _ & "もう一度やり直してください。" Else Session("UserID") = DSLogin.Tables("UserInfo"). _ Rows(0).Item("UserID") Session("UserName") = txtUserName.Text Response.Redirect("welcome.aspx") End If End Sub