Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid can't find SQL Cursor
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00304561
Message ID:
00305951
Vues:
35
Hi, I found that the best method of dealing with "SQL" grids in VFP6 is to set the Grid.RecordSource to ' ' (a single space character) while setting the individual columns ControlSource to the required alias.field. Then when I am ready to display data, I set the RecordSource to the SQL statement and issue a Refresh.

Hope that helps.

>>>I have recently acquire VFP6 and am trying to adapt a VFP5 app. I have a number of pages with grids populutated using either a Select SQL or a QPR. They work perfectly in VFP5, but in 6 I get an 'alias not found' error before the form even loads. The alias is the cursor which is the result of the SQL Select in the Grid Recordsource.
>>
>>I had that problem too...Try removing all sources for the grids, and rebuilding. It should work okay, but whatever table is selected will appear in the grid (you can set recordsource = '' (empty string) in grid Init to avoid this). But the main thing is to get a fresh start, without any errors.
>>
>>Anyway, it should run without error after this. Now, go back and add the sources to the grids again freshly, and try rebuilding.
>
>Bruce,
>
>It seems to me that Grids Initialise differently in VFP6 to VFP5. In 5 I often had to put the fields in the Column.controlsource property, or the Column.textbox.controlsource property to get the grid to display properly. This means to that the order of selection of fields in the cursor is not important, because the column can be set to whatever field is desired.
>
>But it seems to me that in 6 the column initialises before the grid and if the cursor is referred to either in the column or a textbox in the column, then an error occurs. This means that columns either have to be set programatically or else the order of fields in the cursor must correspond to the fields I wish to display in the grid, because the column.controlsource and column.textbox.controlsource are empty and the grid fills directly from the grid.recordsource
>
>Is this how you read it?
>
>David
Petras Virzintas
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform