How can I check to see if a record was loaded. If the person enters a bad
username or bad password it would not find a record and thus fail the check.
SO there would be no record loaded into objDataTable. How can I check this
so I can make them start again?




        '--------------------------------

        'AUTHENTICATE SECTION

        '--------------------------------

 

        '---------- Get Username from the form ----------

        Dim strUserNameWeb As String

        strUserNameWeb = Username.Text

        '------------------------------------------------------

 

        '---------- Get Password from the form ----------

        Dim strPasswordWeb As String

        strPasswordWeb = Password.Text

        '------------------------------------------------------

 

        '---------- Get Subject from the form ----------

        Dim strSubjectWeb As String

        strSubjectWeb = Subject.Text

        '------------------------------------------------------

 

        '---------- Get Message from the form ----------

        Dim strMessageWeb As String

        strMessageWeb = Message.Text

        '------------------------------------------------------

 

 

        'Open connection and check user and password.

        Dim objConnPass As OleDbConnection

        Dim objConnStringPass As String =
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" &
Server.MapPath("~/DB/belcherman.mdb")

        objConnPass = New OleDb.OleDbConnection(objConnStringPass)

        '---------------------------------------------------------

 

        'Build SQL String --------------------------------------

        Dim strSQLstringPass As String

        Dim objDataTable As DataTable = New DataTable

 

 

        'strSQLstring = "SELECT * FROM tblBTCold WHERE Username = @Username"

        'strSQLstringPass = "SELECT * FROM tblBTC WHERE [Username] = '" &
strUserNameWeb & "' And [Password] = '" & strPasswordWeb & "'"

        strSQLstringPass = "SELECT * FROM tblBTC WHERE [Username] =
@Username And [Password] = @Password"

        Dim sqlcmdPass As OleDbCommand = New OleDbCommand(strSQLstringPass,
objConnPass)

        Dim sqldaPass As OleDbDataAdapter = New OleDbDataAdapter(sqlcmdPass)

 

        sqlcmdPass.Parameters.Add("@Username", OleDbType.VarChar).Value =
Username.Text

        sqlcmdPass.Parameters.Add("@Password", OleDbType.VarChar).Value =
Password.Text

 

 

        objConnPass.Open()

        sqldaPass.Fill(objDataTable)

        objConnPass.Dispose()



[Non-text portions of this message have been removed]



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to