Large Bitmask Operation

R

Remy

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.
 
B

Bob Barrows

Remy said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top