Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Removing items in a listbox with a SQL source
Message
 
À
27/09/2003 04:50:27
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00832474
Message ID:
00834019
Vues:
22
>>>>Hi all,
>>>>
>>>>I'm building a work order form that has a listbox on a pageframe that is populated with a SQL statement so that the items related to that order are the items in the list box. The user needs to be able to remove items from the order. I'm having problems getting this to work.
< snip >
>>Using the code you suggest, am I still limited to the total number of characters in the rowsource property? It seems to be 255 characters using the property page.
>
>Matthew,
>Notice that in sample code it might already be over 255 (I didn't count:). The 255 limit is for literal strings. Otherwise a string variable can hold up to 16Mb. ie:
>
>myVar = "assume this is over 255..." && Illegal
>myVar = "this is less than or equal to 255..."+;
>"this is less than or equal to 255..."+;
>"this is less than or equal to 255..." && Legal
>
>While setting properties in PEM sheet you're limited to 255. But if you do that in code as in the above sample limit doesn't apply.
>
>Also notice that while we use only the first 4 columns in listbox display, cursor has more columns than that. Actually even if your list would show only 1 column you might have 255 columns in its RowSource. That's you might have as many more columns that you need to store info about (ie: cust_id, order_amt, to_name ...)
>
>If you look closely a row in SQL cursor has a one-to-one relation to list listindex. That's Listindex = 1 and rec #1, 2 = rec #2 and so on. IOW with an SQL rowsourcetype you could think of listbox sort of grid.
>
>Therefore in your SQL have as many columns as you want to store enough info about what to delete. If lstBox.selected(5) = .t. than it means record 5 in your SQL cursor (crsOITems in sample) is selected. Directly use alias.field to access necessary column info. ie: crsOITems.order_id.
>Notice that listbox is only used to check if Selected(nRecno). We don't use list(nRow,nCol) or there is no bound column like thing to check the value. Directly using crsOITems for things like that.
>Cetin

You are the master of explanations. Thank you for the enlightenment. Sorry to not have gotten your reply sooner, things break and I have to take off the developer cap and become the sysadmin. I get back to programmerland and think "What was I thinking about last week?" Where in Turkey is Izmir? I spent some time in Iran in the mid seventies and really fell in love with the area.
Opportunity is missed by most people beacuse it is dressed in overalls, and looks like work --- Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform