Topaz Filer - Email filing software
Pack dBase
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.odbcnet.


Ales Vojacek
Is there any way how to pack dBase file after delete rows.
Thank you Ales
Reply to this message...
Vote that this is a GOOD answer...
 
New BootFX DBGet build available
Twitter and Snow… simple #uksnow
 
    
Hussein Abuthuraya(MSFT)
Alex,

Using the DataAdapter.Update should physically remove the deleted rows fro mthe file. It scans all the rows and for each row in memory that has a "Deleted" RowState, the
DataAdapter will execute the proper DeleteCommand that is hooked to the DataAdapter.

I hope this helps!

Thanks,
Hussein Abuthuraya
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

Reply to this message...
Vote that this is a GOOD answer...
 
Windows 7 compatible tool for mounting ISO images
Introduction to BootFX’s Object Relational Mapping Functionality article now live on CodeProject
 
    
ales vojacek
I don't think so, deleted rows are still in a dbf file
(the size of file is same as before delete). I think that
these rows have only deleted flag and are not physycaly
removed from the file.
Ales

[Original message clipped]

each row in memory that has a "Deleted" RowState, the
>DataAdapter will execute the proper DeleteCommand that is
hooked to the DataAdapter.
[Original message clipped]

FREE Security Tool Kit, please visit
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Hussein Abuthuraya(MSFT)
OK, I just tried that and here is how I got it to work:

Dim cn As New OdbcConnection("Driver={Microsoft Visual Foxpro Driver};SourceType=DBC;SourceDB=D:\VFOX_Data\data1.dbc;")
Dim cmd As OdbcCommand = New OdbcCommand("set Exclusive on;select * from dates;pack")
Try
cn.Open()
cmd.Connection = cn
cmd.ExecuteNonQuery()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try

I just tried that on a Foxpro table and it worked. The same should apply to the dbase file.

I hope that helps!

Thanks,
Hussein Abuthuraya
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

Reply to this message...
Vote that this is a GOOD answer...
 
Xenu Link Sleuth
Chromium OS – really?
 
    
Ales Vojacek
Thanks, but it is not Ok
Here is an error
Message    "ERROR [42000] [Microsoft][ODBC dBase Driver]
Invalid SQL statement;
expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT',
or 'UPDATE'."    string

[Original message clipped]

Driver};SourceType=DBC;SourceDB=D:\VFOX_Data\data1.dbc;")
> Dim cmd As OdbcCommand = New OdbcCommand("set
Exclusive on;select * from dates;pack")
[Original message clipped]

FREE Security Tool Kit, please visit
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
Invocation Software – the new name for the makers of Topaz Filer
Agile Modeling
 
    
Hussein Abuthuraya(MSFT)
You are using the dbase driver and my sample code that I tested uses the Visual FoxPro Driver. You need to use that driver so that you don't get the error.

Thanks,
Hussein Abuthuraya
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

Reply to this message...
Vote that this is a GOOD answer...
 
 
    
Ales Vojacek
I have to use FoxPro driver for DBase database??
Thank you for your help.

[Original message clipped]

that driver so that you don't get the error.
[Original message clipped]

FREE Security Tool Kit, please visit
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
Creating colourways for Web development
URL shortening as a service
 
    
Hussein Abuthuraya(MSFT)
The Visual FoxPro driver works with dbase files and it solves some of the problems with the dbase ISAM driver. It looks like the file Pack problem is one of them.

Thanks,
Hussein Abuthuraya
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.

Reply to this message...
Vote that this is a GOOD answer...
 
New BootFX DBGet build available
Twitter and Snow… simple #uksnow
 
    
Ales Vojacek
Thanks it works, but when I try to insert any row into a
table using the foxpro driver it ends with error :
"ERROR [22018] [Microsoft][ODBC Visual FoxPro Driver]Data
type mismatch.".
Now I am using the FoxPro driver for pack database and the
dBase driver for inserting into tables.
Thanks a lot for your help.
Ales

[Original message clipped]

It looks like the file Pack problem is one of them.
[Original message clipped]

FREE Security Tool Kit, please visit
[Original message clipped]

Reply to this message...
Vote that this is a GOOD answer...
 
 
 
System.Data.Common.DataAdapter
System.Data.Odbc.OdbcCommand
System.Data.Odbc.OdbcConnection
System.Windows.Forms.MessageBox




Topaz Filer - Email filing software
Ad
BootFX
Reliable and powerful .NET application framework.
Looking to invest in a major software project? Technical and commercial advice available here.
Other Helpful Sites
MBR 247
Topaz Filer
SharePoint Email Filing
Software Advisory Services
 
Copyright © AMX Software Ltd 2008-2010. Portions copyright © Matthew Baxter-Reynolds 2001-2010. All rights reserved.
Contact Us - Terms of Use - Privacy Policy - 4.0.30129.1734