Random record from several fields

Results 1 to 2 of 2

Thread: Random record from several fields

  1. #1
    Join Date
    Dec 1969

    Default Random record from several fields

    I&#039;ve got a database that has 10 fields called file1, file2, file3 respectively. Some of these fields are blank and some have filenames in them. What I am interested in doing is pulling at random one of those files without pulling a blank record. <BR><BR>My question is how would I go about putting all of the file1, file2, file3, etc in to an array? I assume after I had everything in an array I could pull a random number and have an if then statement to eliminate whether or not the record was blank.<BR><BR>If anyone has any ideas I would appreciate it.<BR><BR>Thanks<BR>-Matt

  2. #2
    Join Date
    Dec 1969

    Default ADODB.RecordSet.GetRows method...

    Look it up in the docs.<BR><BR>It converts the *entire* recordset into a two dimensional array and then you can do exactly what you proposed, using the elements of that array.<BR><BR>I must say that I am suspicious about the efficacy of your database design. Ten fields named file1, file2, etc.??? Sounds like a REAL good candidate for normalization, to me. And if you did that, you wouldn&#039;t even have any blank file names in your recordset.<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