Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tracking how many records currently fetched (asynchronou
Message
From
08/10/2005 12:02:27
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
08/10/2005 11:50:51
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9
Database:
MS SQL Server
Miscellaneous
Thread ID:
01057402
Message ID:
01057466
Views:
10
>
>CursorGetProp('RecordsFetched', 'myAlias')
>
>
>
>Many thanks to Cetin and Fabian for this answer. It seems so simple, but I've searched high and low for an answer to this, and even a FAQ on this site only suggested keeping a track by setting how many records get fetched at each pass and keeping count yourself.
>
>
>
>> If it's very large table then why are you using:
>
>
>SQLExec(hConn, "select count(*) AS rcount from verylargefile","rcount")
>
>
>> That info is readily available in sysindexes.ie:
>
>
>SQLExec(hConn, "select rowcnt from sysindexes"+;
> " where id=object_id('verylargefile') and indid<2",'rcount')
>nTotalRecordsToFetch=rcount.rowcnt
>
>
>
>Well, I guess I know virtually nothing about SQL Server - I'm just beginning. My version seems to work reasonably fast. Could you tell me what the benefit is of your version?
>
>
>Now a follow-up question:
>
>I've added this line at the top of the code. This is to close the cursor that I will load the data into, if it already exists.
>
>USE IN SELECT("getreg")
>
>
>
>Now if I run the code, then first time, it works. If I cancel it (press ESC), and then run it again, I get an error on this line of code:
>
>Connectivity Error: [Microsoft][ODBS Driver Manager] Function sequence error
>
>I cancel this and try again (run 3), and it works normally. Run 4 then fails in the same way.
>
>What is happening here, and how do I prevent it?
>
>thanks
>Ben

Your version would work fast because you're using SQL server:) My version is faster though not 100% returns the exact count (operations should have updated the sysindexes for exact match).

Fetching is still continuing. SQLCancel first.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform