Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Packing of dbf file in ADO ?
Message
From
03/03/2004 22:33:07
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
03/03/2004 05:54:48
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00877587
Message ID:
00882974
Views:
16
>Thank for your example, will test it out.
>
>However, I using free table without the .dbc file,
>can I just open the dbf file and pack it ?

The following worked for me with a free table. However, I had trouble when there were spaces in the path of the Data Source:
Option Explicit

Sub Main()

    Dim cnConn As ADODB.Connection
    Dim cmdCommand As ADODB.Command

    Set cnConn = New ADODB.Connection
    cnConn.Open "User ID=;DSN=;" & _
         "Cache Authentication=False;Data Source=""C:\Temp\"";" & _
         "Password=;Provider=""VFPOLEDB.1"";Collating Sequence=MACHINE;Mask Password=False;Mode=Share Deny None;" & _
         "Extended Properties=;Encrypt Password=False;"
    
    Set cmdCommand = New ADODB.Command
    cmdCommand.CommandType = adCmdText
    Set cmdCommand.ActiveConnection = cnConn
    cmdCommand.CommandText = "SET EXCLUSIVE ON"
    cmdCommand.Execute
    cmdCommand.CommandText = "PACK TestDelete"
    cmdCommand.Execute

End Sub
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform