Unique form field names in a SQL recordset loop?

Results 1 to 2 of 2

Thread: Unique form field names in a SQL recordset loop?

  1. #1
    Join Date
    Dec 1969

    Default Unique form field names in a SQL recordset loop?

    HI,<BR>I am displaying a recordset on a page and each row contains form text fields, how can I make sure that each row contains unique form field names?

  2. #2
    Join Date
    Dec 1969

    Default You should really enforce this...

    ...at the database end and set the field in the table as unique (in some situations you&#039;d have the form field names together with another field unique - it&#039;ll depend on your setup). It&#039;s a lot harder to check for uniqueness once you&#039;re looping through the date.<BR><BR>Anyway, if you don&#039;t have the choice, you&#039;d have to fill an array as you loop through with the form field names and loop through this for each entry to check whether it already exists:<BR><BR>1. Open recordset<BR>2. Create empty string array<BR>3. For each record<BR>4. For each item in string array<BR>5. Is current form field name (from recordset) equal to current item in string array?<BR>6. If so, we have a duplicate<BR>7. If not, continue with next string array until the end (go to 4)<BR>8. Add form field name to string array<BR>9. Do other code<BR>10. Until end of recordset, go to 3<BR><BR>Oliver.

Posting Permissions

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