Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Again, troubles with CursorAdapter
Message
De
14/08/2003 03:45:31
 
 
À
13/08/2003 08:59:14
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00819734
Message ID:
00820040
Vues:
19
>Hello, everyone
>
>Only two possibilities here: or I am the dummiest person in the world, or the CursorAdapter has one of the worse implementations I've ever seen.
>
>Can anyone enlighten me?
>
>a). How to add the cursoradapter classes in DataEnviroment in Form Designer _KEEPING_ the settings I made in the class? For example, uid field and updatable fields are lost, and I have to set them again!
>
>b) If the selectmd is a join, in the class I see the fields correctly (table1.field1, table1.field2, table2.field3, table2.field4). However, this information is lost when adding the cursoradapter in DE with form designer. The cursor added looks like this: table1.field1, table1.field2, table1.field3, table1.field4! Or only fields from table1 are updateable (in original class). When dealing with 100 fields this is a PITA, because I have to open the original class, look at the fields, open the form, set those I remember, looking back at the class, looking back at the form.... someone is playing with my mind here.
>
>c) The cursoradapter uses a SQLSTRINGCONNECT() connection to MSSQLServer. When I issue
>
>SQLEXEC(connectionhandle,"BEGIN TRANSACTION")
>
>it works ok, I see the transaction in Enterprise Manager. BUT: at the first tableupdate, transaction is gone. Where are my transactions? who eats them? that code worked 100% sure with remote views!
>
>c. How to add the cursoradapter in DE with .NoDataOnLoad easily? Why one would execute BeforeCursorFill() method passing it .T.,.T. just to set a property? and anyway, CURSORFILL() executes again BeforeCursorFill, passing it .F., and cursoradapter asks for parameters! Where is remote view's .NoDataOnLoad?
>
>d. I tried to SQLSETPROP(connectionhandle,"Transactions",2) This means Manual Transactions. No mattter what I do, whenever I try to run the form (and I put a SET STEP ON in form's init - cursoradapter exists, but they don't downoad any data) Enterprise Manager shows one open transaction. Who opened it if the connection is set to Manual?
>
>e. I tried another approach: to not use DataEnvironment and open the cursoradapters in form's init. Well... that's another story. The objects are local in init and the cursors are closed as soon as Init finishes. To avoid that I see only two possibilities: 1 - to make them global (yuck) and 2 - to add an array property in the form, to keep them there. Grrr. I don't even dare to think at this.
>
>At the final. CursorAdapter: Genial ideea, less than poor implementation. Can anyone argue? Please. I eagerly await.



Hi Grigore,

SQLSETPROP(connectionhandle,"Transactions",...),SQLCOMMIT() and SQLROLLBACK() should be used to manage SPT transactions.
Other methods can interfere with the way VFP manages SPT transactions internally.

Thanks,
Aleksey.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform