Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid problem when changing cursor
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00608558
Message ID:
00608563
Views:
24
You should set RecordSource of the grid to the empty string before you close the recordsource table/cursor.

>Hi all,
>
>I've got some problems with my grid (ones again)
>
>here my Method's code
>
>
>*--------------------------------------------------
>LOCAL strSql as string
>
>strSql = "asp_GetClientAppel @Id_Client =" + ALLTRIM(STR(client.Id_Client)) + ", @Langue = " + strDblq(Z_Lang)
>
>IF used("apClient") THEN
>	SELECT ("apClient")
>	USE
>ENDIF
>	
>IF SQLEXEC(z_conn,strSql,"apClient") >= 0
>	thisform.pgfClient.pagSpecification.grdVox.RecordSource = ""
>	Select * from ("apClient") INTO CURSOR lCurApClient READWRITE noconsole
>	thisform.pgfClient.pagSpecification.grdVox.RecordSourceType = 1
>	thisform.pgfClient.pagSpecification.grdVox.RecordSource = "lCurApClient"
>ENDIF
>*---------------------------------------------------
>
>
>When I do this, all is allright, the grid stay in his first state all columns are like I designed them.
>
>I tried to suppress the "lCurAPClient" cursor and directly use the "apClient" cursor as RecordSource, but I lose all the grid design.
>
>What's wrong in the following code?
>
>
>*--------------------------------------------------
>LOCAL strSql as string
>
>strSql = "asp_GetClientAppel @Id_Client =" + ALLTRIM(STR(client.Id_Client)) + ", @Langue = " + strDblq(Z_Lang)
>
>IF used("apClient") THEN
>	SELECT ("apClient")
>	USE
>ENDIF
>	
>IF SQLEXEC(z_conn,strSql,"apClient") >= 0
>	thisform.pgfClient.pagSpecification.grdVox.RecordSource = ""
>	thisform.pgfClient.pagSpecification.grdVox.RecordSource = "apClient"
>ENDIF
>*---------------------------------------------------
>
>
>Thanks a lot
>Thierry
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform