p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 26th, 2006, 06:56 PM
Registered User
 
Join Date: May 2006
Location: , , .
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?

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

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 1 July 29th, 2008 01:20 PM
VB 2005 Express Starter Kit - Andrew Parsons BriTheProblem BOOK: Wrox's Visual Basic 2005 Express Edition Starter Kit ISBN: 978-0-7645-9573-8 4 January 12th, 2007 12:02 PM
VB 2005 Express Starter Kit krawdad Visual Basic 2005 Basics 0 May 5th, 2006 11: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



All times are GMT -4. The time now is 11:19 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc