query_csjl.SQL.Clear;
query_csjl.SQL.Add('Delete From blda Where Bh=:Code');
query_csjl.ParamByName('Code').AsInteger := table_blda.fieldbyname('bh').AsInteger;
query_csjl.ExecSQL;
query_csjl.SQL.Clear;
query_csjl.SQL.Add('Pack blda');
query_csjl.ExecSQL;SQL语句好像只能在上面做个删除记号,最后是不是要用Pack语句,如果是的话应该怎么样用呢?多谢了。。
query_csjl.SQL.Add('Delete From blda Where Bh=:Code');
query_csjl.ParamByName('Code').AsInteger := table_blda.fieldbyname('bh').AsInteger;
query_csjl.ExecSQL;
query_csjl.SQL.Clear;
query_csjl.SQL.Add('Pack blda');
query_csjl.ExecSQL;SQL语句好像只能在上面做个删除记号,最后是不是要用Pack语句,如果是的话应该怎么样用呢?多谢了。。
解决方案 »
- InfoPower版本
- 怎样改变filter属性页中的属性
- 谁有《DELPHI 5.X ADO/MTS/COM+高级程序设计篇》这本书的电子版,帮帮忙!先谢谢了
- QUICKREPORT中有自動換行的MEMO嗎?
- GroupBox问题
- 谁能给一个注册表键删除程序,100分相送.在Win2K下,有多个项的键是不能直接删除的,求此程序,UP者也有分送
- 请问如何进行后台打印(用TPrinter)?
- 关于一个ado 连接数据库问题,我用的是sql server 数据库
- 我的老板说,dbgrid的滚动条不好用!
- 紧急求助:有关字体设置问题
- 小问题!!急啊!关于一个sql的书写!!!!在线等啊!
- 放分拉!这样的sql语句怎么解决???
或者query_csjlupdatebatch;
对于Paradox数据库,就麻烦一些了:
// Pack a Paradox or dBASE table
// The table must be opened execlusively before calling this function...
procedure PackTable(Table: TTable);
var
Props: CURProps;
hDb: hDBIDb;
TableDesc: CRTblDesc;begin
// Make sure the table is open exclusively so we can get the db handle...
if Table.Active = False then
raise EDatabaseError.Create('Table must be opened to pack');
if Table.Exclusive = False then
raise EDatabaseError.Create('Table must be opened exclusively to pack'); // Get the table properties to determine table type...
Check(DbiGetCursorProps(Table.Handle, Props)); // If the table is a Paradox table, you must call DbiDoRestructure...
if Props.szTableType = szPARADOX then
begin
// Blank out the structure...
FillChar(TableDesc, sizeof(TableDesc), 0);
// Get the database handle from the table's cursor handle...
Check(DbiGetObjFromObj(hDBIObj(Table.Handle), objDATABASE, hDBIObj(hDb)));
// Put the table name in the table descriptor...
StrPCopy(TableDesc.szTblName, Table.TableName);
// Put the table type in the table descriptor...
StrPCopy(TableDesc.szTblType, Props.szTableType);
// Set the Pack option in the table descriptor to TRUE...
TableDesc.bPack := True;
// Close the table so the restructure can complete...
Table.Close;
// Call DbiDoRestructure...
Check(DbiDoRestructure(hDb, 1, @TableDesc, nil, nil, nil, FALSE));
end
else
// If the table is a dBASE table, simply call DbiPackTable...
if Props.szTableType = szDBASE then
Check(DbiPackTable(Table.DBHandle, Table.Handle, nil, szDBASE, TRUE))
else
// Pack only works on PAradox or dBASE; nothing else...
raise EDatabaseError.Create('Table must be either of Paradox or dBASE ' +
'type to pack'); Table.Open;
end;
2、Access数据库也不需要pack
3、如果是db,dbf数据表,就需要了。有两种方式,一种通过打断文件头和文件体的物理连接,来实现。二种通过文件删除的方法,然后重新创建,这样是最简单快捷的方法。