Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Again, troubles with CursorAdapter
Message
 
 
To
13/08/2003 08:59:14
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00819734
Message ID:
00819775
Views:
22
I can not help with the transaction problem, but if you use CA created by my CABuilder PRG file, there are custom properties that the CA will use for options like NoDataOnLoad and UseCursorSchema parameters used by CursorFill method.

To add a CA that is in a VCX to the DE of a form, right-click in the DE of the form and select Builder... option. Click on the second tab, "2. Cursors" and click the Add... button. Find the VCX you just created with this builder, then select the CA from the VCX you wish to add. Edit the Name and Alias properties in the builder if needed. Add other CAs as needed then close the builder.

The builder will add some method code to the CAs added to the DE. It is perfectly OK to remove all this code as it is also in the same methods of the CAs in your VCX. It also is OK to just leave the code alone.

This, along with setting the DataSource, etc., is also documented in the comments of my CABuilder PRG file.


>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.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform