randomizing letters not number

Results 1 to 5 of 5

Thread: randomizing letters not number

  1. #1
    adam stokes Guest

    Default randomizing letters not number

    i can randomize integers and numbers all day but how do i randomize letters?<BR><BR>cause when i search through a database it only search for text<BR><BR>Do Until objRS.EOF OR bolFound<BR> if (strComp(objRS("tagged"), strID, vbTextCompare) = 0) Then<BR> bolfound = true<BR> else<BR> objRS.MoveNext<BR> end if<BR><BR>that code is searching my database so i can delete records, well i need it to search for a item that doesn&#039t get edited all the time that&#039s why i need to randomize letters rather than numbers, unless someone knows how to make the above code search numbers also?<BR><BR>thanks

  2. #2
    BalletChick Guest

    Default RE: randomizing letters not number

    Huh?<BR><BR>If you want random letters, see my answer about a week or so ago to someone who wanted to generate random characters for password (use the &#039search messageboard&#039 option and look for posts by balletchick).<BR><BR>But, to be honest, I do not understand the rest of your message... you can search a database for numbers OR text, so I do not understand your second paragraph. <BR><BR>Oh... wait. Are you saying that your numeric field that you wish to search is something OTHER THAN the "tagged" field?

  3. #3
    adam stokes Guest

    Default RE: randomizing letters not number

    yea i would like to search my autonumber field that access has when it creates ID&#039s for each record, now the code i pasted previously only searched STRINGS rather than Numbers, and when i try to search the ID it said it couldn&#039t find it because it was not a string.

  4. #4
    Steve Cimino Guest

    Default RE: randomizing letters not number

    You&#039re not really clear on asking what you want, so I&#039ll stick with the title.<BR><BR>You can randomize letters by using their ASCII value. For capital A - Z, the numbers are 65-90. Use a random value in that numeric range, and the convert it back to it&#039s letter.

  5. #5
    BalletChick Guest

    Default RE: randomizing letters not number

    Wellll.... be sure you were searching on the correct field, and be sure that if you are comparing NUMBERS, that you do not use strCompare. Use:<BR><BR> if rs("IDorwhateveryourfieldnameis") = lngNumber then...<BR><BR>Also, you really should consider doing this in the SQL statement, rather than looping through EVERY record in the table looking for matches. That is way too slow, example:<BR><BR> set rs = connection.execute("select * from table1 where ID=5746")<BR><BR>Even this is not the most efficient way, but it is still MANY ORDERS OF MAGNITUDE (probably) more efficient than looping through every record.<BR><BR>

Posting Permissions

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