|
| 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
|
|
|
| |
|
| |
| |
| 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.
|
|
|
| |
|
| |
| |
| 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]
|
|
|
| |
|
|
| |
| |
| 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.
|
|
|
| |
|
| |
| |
| 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]
|
|
|
| |
|
| |
| |
| 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.
|
|
|
| |
|
|
| |
| |
| 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]
|
|
|
| |
|
| |
| |
| 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.
|
|
|
| |
|
| |
| |
| 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]
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|