Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add columns to cursor
Message
From
07/08/2003 12:50:07
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00817815
Message ID:
00817821
Views:
20
>I am trying to add a column to a cursor that will be displayed in a grid. Here is the code:
>
>


>SELECT ALLTRIM(fname)+' '+alltrim(lname) as Person, dob from person INTO CURSOR test readwrite
>ALTER TABLE DBF('test') ADD COLUMN Send L(1)
>thisform.g1.RecordSource='test'
>thisform.g1.Refresh
>


>
>However ALTER command is not working on the cursor. Is there a way to add column to a cursor? Also, in the grid I would like to display this added column (send) as a check box. Can I add checkbox to grid progamatically looking at cursor test.send column?
>
>Thanks
>Nick Patel

You can add the column at the same time as your select
SELECT ALLTRIM(fname)+' '+alltrim(lname) AS Person, dob, .F. AS Send ;
   FROM person INTO CURSOR test READWRITE
You should be carefull when using the alltrim for a field because the field will be the lenght of the first values it gets. So if the first persons name is CHUCK MAUTZ then the length of person will only be 11 then if anyones name is bigger than 11 it will be truncated.
Charles

"The code knows no master." - Chuck Mautz
"Everybody is ignorant, only on different subjects." - Will Rogers
Previous
Reply
Map
View

Click here to load this message in the networking platform