Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filling listbox programmatically
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Filling listbox programmatically
Divers
Thread ID:
00173149
Message ID:
00173149
Vues:
65
Hello all,
I'm encountering a syntax error while trying to populate a listbox with an SQL statement. The SQL looks like this:

.cmbRangeFrom.rowsource = "SELECT costcen.dptname FROM costcen WHERE ( &lcWhereClause ) ORDER BY costcen.dptname into cursor ccfrom"

The Whereclause variable is built up programmatically from a for loop based upon the values in a global array. The for loop looks like this:

FOR lnLooper = 1 to THISFORM.listcount
SELECT areaprop
LOCATE for (areaprop->areaname= gaDataAreaArray(lnLooper))
lcAreaId = areaprop->areapro_id
lcWhereClause = lcWhereClause + iif(lnLooper = 1, "", " OR ") + ;
"costcen.area_id = " + "'" + lcAreaId + "'"
ENDFOR

But there's a catch. If the number of elements OR'd together in the where clause is less than or equal to five, this select works fine. However, when the number is greater than five, I encounter the syntax error. Any ideas?

Thanks!
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform