Ah...
I would then employ a com server, as Doug suggests.
>Steve,
>
>>Hello Steve,
>>
>>I think the only way to accomplish that task would by calling a stored procedure.
>
>Can a stored proc in a DBC pack the DBC itself? I guess I have never tried that... Wait, let's give it a try...
>
>Nope...I get an error: "A stored procedure is executing (Error 1538)" when I try to use a stored proc to pack the database itself...a PACK must try to close everything (including terminating stored procs) before packing, and it can't because the pack proc is still running...
>
>Packing a table should work OK I would think, but packing the database might be a bit tricky. Is there a reason you need the DBC packed at runtime? Seems like more a development-time process...?
>
>JoeK
Steve Gibson