Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File in use error with cursoradapter
Message
 
To
21/02/2008 14:01:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Miscellaneous
Thread ID:
01294910
Message ID:
01294928
Views:
25
This message has been marked as the solution to the initial question of the thread.
>Hi All,
>
>I am having a problem with my cursorfill for my cursoradapter, or just after it.
>
>If the user wanted to see the data collected in a VFP table, after the cursorfill is done, I have to create a database container, because the data coming from SQL Server could be longer then VFP free tables allow. I then do a copy to (thetablename) database (thetablename + "dbc") to put the data into the VFP table. It is at this point that I get a file in use error throw. I can see that the record number on the cursor is going up. Is there a way to make VFP stop and wait until the cursor is totally filled, so that I do not get this error?
>
>Here is my code:
>
>  IF loCursor.CURSORFILL (.F., .F., 0, loCommand)
>    cCursorMade = cTable_name
>    SELECT &cTable_name.
>    IF(cOutput_type = "VFP_DBF") THEN
>      LOCAL lcSafety, lcOutputFileName
>      STORE "" TO lcSafety, lcOutputFileName
>      lcSafety = SET("Safety")
>      lcOutputFileName = IIF(AT(".", cOutputFileName) > 0, ;
>        LEFT(cOutputFileName, AT(".", cOutputFileName) - 1), ;
>        cOutputFileName)
>      SET SAFETY OFF
>      llok = deletedbffiles(cOutputFileName) && delete the physical files if there are any.
>      CREATE DATABASE (lcOutputFileName + "dbc")
>      COPY TO ALLTRIM(lcOutputFileName) DATABASE (lcOutputFileName + "dbc")  <-- this is where it errors
>      SET SAFETY &lcSafety.
>    ENDIF
>  ELSE
>
>
>TIA
>Beth


What are values of
loCursor.FetchSize?
loCursor.MaxRecords?
If they are different that -1 make both of them to -1
loCursor.FetchSize  = -1
loCursor.MaxRecords = -1
IF loCursor.CURSORFILL (.F., .F., 0, loCommand)
   ....
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform