Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
First timer's question about using CursorAdapter Builder
Message
 
 
To
27/06/2005 13:08:29
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01026772
Message ID:
01026806
Views:
23
Once you drop the CA into the DE of a form, that is all you really have to do as long as AutoOpenTables is set to .T. Right-click in the form's DE, then click Builder... Click the Cursors tab. Click the Add button. Find your VCX of adapters then clcik on the CA you want to add to the DE.

After you add the CA, double-click on it in the DE. When you add a CA to the DE of a form, the builder will automatically add some default code to 2 of the methods. You can safely delete all that code as I have included it in the CA base class in the VCX.

If you need to have NoData when the CA is loaded and the cursor created, you can "refresh" the cursor from the INIT code or some custome method like this:

THISFORM.DataEnvironment.AdapterObjectName.CursorRefresh()

If there is a filter (e.g., Where KeyField = ?nKeyValue) in the SELECT command, make sure you set any filter parameters to a valid value before calling the CursorRefresh. For example:

PRIVATE nKeyField
nKeyField = 1234
...CursorRefresh()

>I'm trying out CursorAdapters for the first time. Downloaded your VFP9 builder and created CA's for a DBC. I then set up a simple test project.
>
>The CA's reference VFP native data.
>- I set CLASSLIB to the _ca_*** class at application startup
>- I used the DE builder to add an instance of the _ca in a form's DE.
> used the CURSOR tab only, since the datasource and source type is
> set in _cabase
>- I renamed the CA "NAME" and "ALIAS" in the DataEnvironment builder
>- I made sure the DBC was open and SET DATABASE TO **** in
> the BeforeOpenTables method of the form
>- I put a <_ca_name>.Cursorfill() in the INIT method of the form
>
>The form's INIT code does not see the CA. I get back the message:
>"OBJECT NOT FOUND".
>
>When I reference the _ca in code, it works fine. I'm only having
>trouble when I drop it on the form.
>
>I'm sure that I'm missing something obvious. Any suggestions? I
>am doing a little app where I'd really like to use CA's.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform