Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Unable to ExecScript() COPY TO if data adapter not closed
Message
De
26/01/2007 15:37:20
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Titre:
Unable to ExecScript() COPY TO if data adapter not closed
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01189785
Message ID:
01189785
Vues:
91
I am unable to execute the VFP ExecScript() COPY TO command on a VFP table if a data adapter connection is opened using the table. In the following code, I am issuing SET SAFETY OFF and SET EXCLUSIVE OFF before doing the COPY TO:
            loDataProviderBackup.CommandTextAdd("EXECSCRIPT(""SET SAFETY OFF"")")
            loDataProviderBackup.CommandTextAdd("EXECSCRIPT(""SET EXCLUSIVE OFF"")")
            loDataProviderBackup.CommandTextAdd("EXECSCRIPT(""USE " + lcTable + """)")
            loDataProviderBackup.CommandTextAdd("EXECSCRIPT(""COPY TO '" + lcDirectory + lcTable + "'"")")
            loDataProviderBackup.CommandTextAdd("EXECSCRIPT(""USE"")")

            ' Index
            If Not loDataProviderBackup.ExecuteNonQuery() Then
                Return False
            End If
But, if I have another data provider object having a connection opened on a table that I need to copy, I have a "File is in use" error.

Anyone has a better approach to backup a VFP table from .NET where I would avoid the "File is in use" error message?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform