It's been a long time since I've done any ASP programming, and I've never
done ASP.NET, so it may need some fiddling. Three possibilities come to
mind:
1) Re-write it as a function (or subroutine) in VBScript. I have no idea if
the Randomize or RND functions exist in VBS, so this may not be an option.
2) Create a SQL statement that will use the function and create a recordset
from that. The SQL statement would look something like this:
SELECT DISTINCT CreateRandomPassword(8) AS NewPassword
FROM AnyTable;
Note: Replace "AnyTable" with the name of a table (any table, it doesn't
matter which although the smaller the better).
3) Create the above SQL statement as a saved query and create a recordset
object using the saved query as the table name.
For the specifics of implementing it in ASP, you should probably ask on the
ASP newsgroup.
Oh, and the function I gave won't necessarily guarentee 6 characters and 2
numbers. It will create a string of 8 characters composed of a random
assortment of upper case letters, lower case letters, and numbers, although
it could be modified to do so.
--
--Roger Carlson
MS Access MVP
Access Database Samples:
www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L