Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File in use error with cursoradapter
Message
De
21/02/2008 14:01:44
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
File in use error with cursoradapter
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 2000 SP4
Database:
MS SQL Server
Divers
Thread ID:
01294910
Message ID:
01294910
Vues:
66
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform