Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC cursoradapter - How to close QUICKLY
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01365873
Message ID:
01365878
Views:
15
>>>>I usually do not have reason to use cursoradapters that incrementally fetch data, but my client wants to be able to scroll through a huge SQL table in a grid, so here I am.
>>>>
>>>>In my form's dataenvironment I add a cursoradapter, and using the builder I give it my connection handle, query, max number of records to fetch at a time, select fetch remote data as needed, and left it pretty much like that. No updates will be done - this is strictly a lookup table.
>>>>
>>>>I drop a grid on the form and it works well when just opening the form and scrolling through records - it appears to fetch incrementally nicely.
>>>>
>>>>Now I go to close the form.
>>>>
>>>>3 or 4 minutes later, it actually closes. My assumption is the cursoradapter is pulling the rest of the records for some reason before closing.
>>>>
>>>>Keep in mind - during development my SQL data is out in internetland, so I do expect slow responses, but since I'm not telling the form to retrieve any more data or to update anything, I would expect closing the form to be fast/instant.
>>>>
>>>>I've tried a couple of things in the form Unload event to close the cursor, tell the cursoradapter not to fetch data, etc but apparently I haven't hit the right combination to make it close in a reasonable amount of time.
>>>
>>>Can you open Query Profiler and watch what is going on?
>>
>>No. I don't have admin rights on the server.
>
>Can you post your CA definition?

For the cursoradapter in the dataenvironment, the nondefault properties are..

Alias 'cursoradapter1'
AllowDelete = .F. (Made no difference if AllowWhateverOperation was .T. or .F.)
AllowInsert = .F.
AllowUpdate = .f.
Cursorschema = 'CPARTNO C(18), CPARTDESCRIPTION C(52), IDPARTS I'
datasource = oapplication.odbchandle
datasourcetype = ODBC (I've tried ADO too - same problem)
FetchAsNeeded = .T.
FetchMemo = .F.
KeyfieldList = 'idParts' (I've tried with and without this - since no updates then it should not be needed)
Name = cursoradapter1
SelectCmd = 'select cpartno,cpartdescription,idparts from base.parts order by cpartno'
SendUpdates = .f.

AutoOpen and Init methods are standard VFP cursoradapter code from the builder.

I've set FetchSize to various sizes and the cursoradapter seems to fetch that many records when it needs them.
____________________________________

Don't Tread on Me

Overthrow the federal government NOW!
____________________________________
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform