I have various functions in VBscript which take numeric values from an SQL database and perform bitmasking to determine matches. Better to show than try and explain:
The database may have a table with the following structure (example that doesn't actually exist)
Fields: ID, Description
The data contains:
I use bitwise operands to determine who has access to a part of the web application. So if the part of the application is marked with permissions of 37, the bitwise calculation determines that Sales(32), Marketing(4) and Admin(1) have access (32+4+1).
I use this method for a number of different things and have happily used this for a number of years.
I now have an issue in that one area were enumeration is used will potentially have hundreds of options. This poses a couple of problems.The numbers start to get so huge that the DB won't be able to store them as numeric types (SQL's BIGINT allowing storage of 64 items using my calculations). Secondly, VBScript itself will have problems trying to do a bitwise calculation on a number which is so large - it will be too large to be convertible to any VB number types.
I'm sure someone must have come up with a solution but I've searched around and found glimpses of ideas. I think it may be possible to store the data in the DB as a binary varchar thus allowing me to store the actual number. I would then have the problem of converting that number to something that VBScript can operate on to determine the result.
I also use SQL Reporting Services so any solution for VBScript would need to be useable in that too.
All help is appreciated.