Large Bitmask Operation

Discussion in 'ASP General' started by Remy, May 22, 2009.

  1. Remy

    Remy Guest

    I use bitmasks in tandem with MS SQL Server, used for access permissions but
    also option lists.

    I have used this for many years happily. I now have the situation were an
    option list which was supposed to contain a few items (easily enumerated)
    will potentially have to hold 100s of items.

    My issue is that VBScript will not be able to operate on these large numbers
    as they will be beyond any numeric type inherent in VBScript. I could use a
    binary varchar in SQL to store values but have the problem of using bitwise
    comparision in VBScript.

    I'm sure there must be a way of checking sizes and cutting up the binary
    into manageable chunks but I have no idea even how to attempt this.

    I've read some stuff on SQL managing this type of thing but I need a VBS
    solution.

    All help is appreciated.
    Remy, May 22, 2009
    #1
    1. Advertising

  2. Remy

    Bob Barrows Guest

    Remy wrote:
    > I use bitmasks in tandem with MS SQL Server, used for access
    > permissions but also option lists.
    >
    > I have used this for many years happily. I now have the situation
    > were an option list which was supposed to contain a few items (easily
    > enumerated) will potentially have to hold 100s of items.
    >
    > My issue is that VBScript will not be able to operate on these large
    > numbers as they will be beyond any numeric type inherent in VBScript.
    > I could use a binary varchar in SQL to store values but have the
    > problem of using bitwise comparision in VBScript.
    >
    > I'm sure there must be a way of checking sizes and cutting up the
    > binary into manageable chunks but I have no idea even how to attempt
    > this.
    >
    > I've read some stuff on SQL managing this type of thing but I need a
    > VBS solution.
    >

    When you get to this point, you really need to move away from bitmasks and
    use your relational database to do what it's supposed to do. Filtering by
    bitmask is never efficient since every row has to be read (you cannot use a
    bitwise comparison to create an index). You will need to create a table to
    hold the option values and keys, and another table to link the users to the
    options.

    --
    Microsoft MVP - ASP/ASP.NET - 2004-2007
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
    Bob Barrows, May 22, 2009
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rod Nibbe

    Bitmask & Graphics Question

    Rod Nibbe, Oct 26, 2004, in forum: Java
    Replies:
    2
    Views:
    1,627
    Rod Nibbe
    Oct 26, 2004
  2. Andrey Brozhko
    Replies:
    1
    Views:
    1,102
    Andrey Brozhko
    Dec 10, 2004
  3. =?iso-8859-9?Q?Tongu=E7?= Yumruk

    Bitmask representation of integers

    =?iso-8859-9?Q?Tongu=E7?= Yumruk, Oct 8, 2003, in forum: Python
    Replies:
    3
    Views:
    870
    Scott David Daniels
    Oct 8, 2003
  4. Xah Lee
    Replies:
    0
    Views:
    336
    Xah Lee
    Apr 23, 2007
  5. Patrick

    Simple Bitmask problem

    Patrick, Jul 18, 2007, in forum: C Programming
    Replies:
    4
    Views:
    748
    Thad Smith
    Jul 19, 2007
Loading...

Share This Page