While not using BDE, I tyr to connect to my DB using ADO.
Does anyone know, how, in Delphi, using ADO and ODBS driver for dBase
files, I can pack the dBase tables?
var Ai : OleVariant
CoInitialize(nil);
connection := CreateOleObject('ADODB.Connection') as _Connection;
connection.Open('Data Source=test', sUsername, sPassword, 0);
connection.Execute('Set Exclusive On', Ai, adCmdText);
connection.Execute('Pack test.dbf', Ai, adCmdText);
The 2 last lines cause the problems, an error message telling me, that
I can only user insert,update etc... verbs for direct changes into the
database.
The problem is, once deleted, a row is marked deleted, but is still
present in the file. Therefore packing it makes the file (much)
smaller.


|