Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CursorAdapters
Message
De
18/05/2005 23:13:27
 
 
À
18/05/2005 20:40:17
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01015654
Message ID:
01015679
Vues:
22
Michael,

Your local locursor reference to the cursoradapter goes out of scope and vaporizes when the program finishes. If a cursoradapter reference goes out of scope the cursor is automatically closed. Either use CursorDetach method to detach the cursor or keep the CA reference in scope.

>The cursor created with the code below, disappears when the wait window is clicked. The grid is populated as it should be, but as soon as the wait window is clicked the grid is cleared and the cursor disappears.
>
>As I am new to CursorAdapters, any help would be apprectaited.
>
>Sincere thanks in advance.
>
>Mike Mayo
>
>** code **
>thisform.grid1.recordsource='0'
>local locursor as cursoradapter, laerrors(1)
>set multilocks on
>locursor = createobject('CursorAdapter')
>locursor.alias = 'pdv'
>locursor.datasourcetype = 'ODBC'
>locursor.datasource = sqlstringconnect(remotedsn)
>locursor.selectcmd = 'select urn,podept,gst_tax_pc,addinfo,active from podept order by urn'
>locursor.keyfieldlist = 'urn'
>locursor.tables = 'podept'
>locursor.updatablefieldlist = 'urn, podept, gst_tax_pc, addinfo, active'
>locursor.updatenamelist = 'urn podept.urn, podept podept.podept, gst_tax_pc podept.gst_tax_pc, addinfo podept.addinfo, active podept.active'
>if locursor.cursorfill()
> thisform.grid1.recordsource='pdv'
> thisform.grid1.refresh()
> WAIT window
>else
> aerror(laerrors)
> =messagebox(laerrors[2])
>ENDIF
>** end code **
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform