Results 1 to 8 of 8

Thread: value in dataset: not resolved???

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2003
    Location
    Europe, Belgium
    Posts
    84

    value in dataset: not resolved???

    Hi, I'm here again

    I found a code snippet to retrieve the value of the first row and the column 'RightsID' of the tblUsers in a dataset (DSUsers)

    The Column RightsID is an integer in the underlying access database.

    The strange thing is that I can show the requested value in a messagebox by the following code:

    MsgBox(DSUsers.Tables("tblUsers").Rows(0)("RightsID"), MsgBoxStyle.Critical, "Bedrijf gevonden")

    The shown value is '2' and this is correct.

    But when I want to assign the value to a defined integer variable, the value is '0', which is not correct because it should be '2'
    I used the following code:

    dim UserRights as Integer
    UserRights = DSUsers.Tables("tblUsers").Rows(0)("RightsID")

    Is there anybody who can help me???

    Thanx,

    Tom

  2. #2
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    a stab in the dark i know but what type is RightsID in the database? Is it an integer or a string?
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2003
    Location
    Europe, Belgium
    Posts
    84
    RightsID is an integer in the underlying database.

    Tom

  4. #4
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    zip up the application and the database and i'll have a look for you.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Oct 2003
    Location
    Europe, Belgium
    Posts
    84
    thanks nswan,

    I found another way to get to the same result, but I still am interested to know why I can't assign that value to the variable.

    The problem is in Form1 and in the Sub 'Checkuser'. It are the last two lines which I commented.

    The sourcecode is added and the database is added in the next post (I only added the userdatabase because the other database is not necessary for this specific problem).


    Kind regards,

    Tom
    Attached Files Attached Files

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2003
    Location
    Europe, Belgium
    Posts
    84
    database
    Attached Files Attached Files

  7. #7
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Reading, UK
    Posts
    870
    i'll have to check later when i get home as i don't have VS 2003 here only 2002.
    www.vb-tech.com
    .Net Freelance Development
    http://weblog.vb-tech.com/nick
    My blog

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Oct 2003
    Location
    Europe, Belgium
    Posts
    84
    no problem,

    thanks in advance,

    Tom

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width