Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 26th, 2006, 05:56 PM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB starter kit - Rowfilter code doesn't work

I'm working through the tutorials in the Wrox VB 2005 starter kit and there's some code that doesn't seem to work. It's the code to check that the user has entered a password correctly on the login screen:

        Dim CheckUserDataView As DataView = CheckUserTable.DefaultView
        CheckUserDataView.RowFilter = "Name = '" + UserName + "'"
        With CheckUserDataView
            If .Count > 0 Then
                If .Table.Rows(0).Item("Password").ToString.Trim = Password Then
                    Return True
                Else
                    MessageBox.Show(.Table.Rows(0).Item("Password").To String.Trim)
                    Return False
                End If
            Else
                Return False
            End If
        End With

I can see how it should work, but for some reason it always picks the first row from the unfiltered table. In other words, CheckUserDataView.Count is 1, but there seems to be more than 1 item in the filtered dataview. As far as I can see, using the .Table.Rows method returns items from the unfiltered dataview and I can't understand why this should be happening.

Anybody know what's going on?






Similar Threads
Thread Thread Starter Forum Replies Last Post
paypal commerce starter kit learnit BOOK: Beginning ASP.NET 2.0 AJAX ISBN: 978-0-470-11283-0 2 March 26th, 2010 12:50 PM
VB 2005 Express Starter Kit krawdad Visual Basic 2005 Basics 0 May 5th, 2006 10:32 AM
Re: Movie Starter Kit desertfox05 Visual Basic 2005 Basics 0 February 26th, 2006 10:07 PM
wrox book on VB 2005 Express starter kit webgeo99 Visual Basic 2005 Basics 1 February 22nd, 2006 08:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.