Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursorfill or requery()?
Message
From
26/10/2003 11:28:45
 
 
To
26/10/2003 02:21:36
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00842623
Message ID:
00842729
Views:
25
Hi Aleksey

The problem seems to be the order in witch events fire at instantiation. It´s different when you instantiate a cursoradapter in code, the Init event fires before all others, as you´d expect. But with a cursor in the dataenvironment of a form the event´s order changes:

DE.Opentables
DE.BeforeOpenTables
CA.AutoOpen
CA.BeforeCursorFill
CA.CursorFill
CA.AfterCursorFille
CA.Init
DE.Init

1. CA.Init fires before DE.init
2. CA.CursorFill fires before CA.Init

So if you put code that initializes the Datasource and DatasourceType in CA.Init that code doesn´t work because CA.CursorFill was instatiate before.
It´s very extrange behaivor and it´s not well documented or at least I don´t find documentation.

My cursors are not well instantieted, that is why when I used cursorfill() instead of requery() they work, because they are instantieted again.

>Do you call SQLPREPARE() for that connection anywhere in your code?
No I don´t. This sql commands are the same of my remote views and It works very well with them.

>How do you set CursorAdapter(s) properties? Do you use Prepared=.T. for any >CursorAdapter object or remote view which use that connection?
I use Prepared=.T.

>Do you check return value from REQUERY? Does it report any error? What is >it?
The error is:
"View definition has been changed (Error 1494)
The view cannot be re-queried.
The view definition in the database has been changed.
Close and reopen the view. To ensure that the view is not changed, open the database exclusively."

It´s totally inconsistend error.

Do you have a suggestions or recomendations.

Thanks for your time

Carlos

>Hi Carlos,

>Do you check return value from REQUERY? Does it report any error? What is >it?

>How do you set CursorAdapter(s) properties? Do you use Prepared=.T. for any >CursorAdapter object or remote view which use that connection?

>Do you call SQLPREPARE() for that connection anywhere in your code?

>It sounds like you are able to reproduce the problem pretty consistently, >could you provide a repro code?

>Thanks,
>Aleksey.


>Hi Aleksey
>
>Thanks for your answer. The problem is exactly the following:
>
>When I create parametrizised cursor in ODBC like my remote views:
>Select * from customers where ID like ?thisform.lcID
>
>requery works fine with your own connection, but when I share the connection with DE, I have to use cursorfill(), becuase requery doesn´t work.
>
>I download VFP8 SP1 and installed but the problem persits.
>
>Do you have another idea?.
>
>Thanks for your time.
>
>Carlos
>
>
>>Hi Carlos,
>
>>VFP8 SP1 resolves some issues with REQUERY() function, have you tried it? Do >you still see the problem? Could you provide more details about it?
>
>>Thanks,
>>Aleksey.
>
>
>
>>Hi everyone
>>
>>I´m working with cursoradapter to replace my remote views. But the requery seems not work properly, sometimes does sometimes doesn´t, so I replaced it with cursorfill and it works fine.
>>
>>Some body knows why?, the solution is not a problem for my, but is more easy to me write:
>>
>>select
>>customer
>>requery()
>>
>>than :
>>
>>thisform.dataenvironment,cursoradapter1.cursorfill()
>>
>>because the dataenvironment intellisense doesn´t work in the form.
>>If I would have intellisense it would be easy.
>>
>>Do you have a sussgestion?
>>
>>Thanks
>>
>>Carlos
Carlos A. Miranda
E.I.S.lnc
President
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform