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 **