>From the VFP 9 help file: "Speeding up Data Retrieval" Controlling Cursor Fetching If you want to fetch the entire cursor, you can issue the GOTO BOTTOM command, or any command requiring access to the entire data set.
I read this as RECCOUNT() being one of the other commands as it would require access to the entire data set. Try this: nHandle = SQLSTRINGCONNECT(lcCStr) ?"Set Asycn Mode" ??SQLSETPROP(nHandle,"Asynchronous",.T.) lcSQL = "SELECT * FROM email ORDER BY sent" ?lcSQL ?"First Call:" ??SQLEXEC(nHandle,lcSQL,"csrTest") + " " DO WHILE SQLEXEC(nHandle) = 0 ??"." =INKEY(.25) ENDDO -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Ellenoff Sent: Friday, November 28, 2008 12:07 PM To: [EMAIL PROTECTED] Subject: Async not working, what am I doing wrong? I cannot seem to get an asynchronous connection to work. Am I missing something obvious? Despite the call to SQLSETPROP("Asychrounous",.T.), the SQLEXEC() locks until the entire result set is returned, despite finishing with a 0 return value. I've tried in VFP8 & 9SP1 & SP2 hitting a PostgreSQL database, with no luck. The code below hits a table with 16,000 records. The first SQLEXEC call takes about 5 minutes to finish executing and returns a 0. The next call returns a 1 and finishes immediately. Reccount() shows 16,000 for both calls. What's going on? Could it be a bug specific to PostgreSQL and/or their ODBC driver? CLOSE ALL CLEAR LOCAL lcDriver, lcServer, lcUserId, lcPassword, lcCStr, lnOption, lcOptionString, lcSQL lcDriver = "PostgreSQL ANSI" lcServer = "VXP-POSTGRES" lcUserId = "xxx" lcPassword = "xxx" lcDatabase = "test" lnOption = 0 lcOptionString = ";OPTION=" + ALLTRIM(STR(lnOption)) lcCStr = "DRIVER="+lcDriver+";SERVER="+lcServer+";DATABASE="+lcDatabase+";UID="+lcUse rID+";PWD="+lcPassword+";B9=0" lcCStr = lcCStr + lcOptionString ?lcCStr nHandle = SQLSTRINGCONNECT(lcCStr) ?"Set Asycn Mode" ??SQLSETPROP(nHandle,"Asynchronous",.T.) lcSQL = "SELECT * FROM email ORDER BY sent" ?lcSQL ?"First Call:" ??SQLEXEC(nHandle,lcSQL,"csrTest") ?"Rec Count:" ?RECCOUNT("csrTest") ?"Second Call:" ??SQLEXEC(nHandle,lcSQL,"csrTest") ?"Rec Count:" ??RECCOUNT("csrTest") [excessive quoting removed by server] _______________________________________________ Post Messages to: ProFox@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/profox OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.