Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unable to ExecScript() COPY TO if data adapter not closed
Message
From
26/01/2007 15:37:20
 
 
To
All
General information
Forum:
ASP.NET
Category:
Databases
Title:
Unable to ExecScript() COPY TO if data adapter not closed
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01189785
Message ID:
01189785
Views:
93
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
Next
Reply
Map
View

Click here to load this message in the networking platform