Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is VFP too fast for SQL Server
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
MS SQL Server
Divers
Thread ID:
01038128
Message ID:
01038862
Vues:
19
Check for the value of CursorFill before the Select statement and see what's returning. That way you'll know if the cursor has been created.

From VFP9 help


If CursorFill returns False (.F.), the cursor is discarded. In this case, the BeforeCursorClose and AfterCursorClose events do not occur. To retrieve error information when CursorFill returns False (.F.), you must call the AERROR( ) function because Visual Foxpro error handling, such as the ON ERROR command, Error event, and TRY...CATCH...FINALLY command, does not capture this error information.






>Here's the little test program I was working with. It fails at the "select CalcVarCursor" line near the bottom, but only when running normally. When tracing, it does not fail.
>
>
>oDE = newobject("LOCIDataEnv", "source\LOCIAnalysisData")
>oDE.OpenTables()
>
>* ------------------------------------------------------------------------
>* Fill ACalcVarCursor.
>* ------------------------------------------------------------------------
>oDE.ACalcVarCA.NoData = .f.
>oDE.ACalcVarCA.CursorFill()
>
>* ------------------------------------------------------------------------
>* Get rid of existing records.
>* ------------------------------------------------------------------------
>select ACalcVarCursor
>delete all
>? "TableUpdate after DELETE ALL on ACalcVarCursor returned " + transform(tableupdate(.t.))
>oDE.ACalcVarCA.CursorRefresh()
>
>* ------------------------------------------------------------------------
>* Append from ACALC_VA and save to SQL Server table.
>* ------------------------------------------------------------------------
>select ACalcVarCursor
>append from data\acalc_va
>replace all projectid with 0
>? "TableUpdate after APPEND FROM ACALC_VA returned " + transform(tableupdate(.t.))
>oDE.ACalcVarCA.CursorRefresh()
>
>* ------------------------------------------------------------------------
>* Fill AnalysisCursor.
>* ------------------------------------------------------------------------
>oDE.AnalysisCA.NoData = .f.
>oDE.AnalysisCA.CursorFill()
>
>* ------------------------------------------------------------------------
>* Get rid of existing records.
>* ------------------------------------------------------------------------
>select AnalysisCursor
>delete all
>? "TableUpdate after DELETE ALL on AnalysisCursor returned " + transform(tableupdate(.t.))
>oDE.AnalysisCA.CursorRefresh()
>
>* ------------------------------------------------------------------------
>* Append from ANALYSIS and save to SQL Server table.
>* ------------------------------------------------------------------------
>select AnalysisCursor
>append from data\analysis
>replace all projectid with 0,;
>            linenumber with -recno()
>? "TableUpdate after APPEND FROM ANALYSIS returned " + transform(tableupdate(.t.))
>oDE.AnalysisCA.CursorRefresh()
>
>* ------------------------------------------------------------------------
>* Fill CalcVarCursor.
>* ------------------------------------------------------------------------
>oDE.CalcVarCA.NoData = .f.
>oDE.CalcVarCA.CursorFill()
>
>* ------------------------------------------------------------------------
>* Get rid of existing records.
>* ------------------------------------------------------------------------
>select CalcVarCursor
>delete all
>? "TableUpdate after DELETE ALL on CalcVarCursor returned " + transform(tableupdate(.t.))
>oDE.CalcVarCA.CursorRefresh()
>
>
>
>>Can you post your code?
>>
>>Enmanuel
>>
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform